Community Wishlist Survey 2023/Miscellaneous/Update TemplateStyles CSS rules to current CSS spec versions

From Meta, a Wikimedia project coordination wiki

Update TemplateStyles CSS rules to current CSS spec versions

  • Problem: The CSS specification is undergoing major changes. For example, CSS logical properties and values, CSS variables, etc. However, TemplateStyles has not kept up with the updated CSS specification. Therefore, when using these new properties and values, you will get the error "Unrecognized or unsupported property" and will not be able to save them.
  • Proposed solution: Update properties and values that are supported by all modern browsers (which can be found by checking Can I use) to correspond to TemplateStyles, unless experimental, deprecated, or cannot be supported for security reasons. If the CSS sanitizer requires significant effort to update to support all CSS, external tools (e.g., stylelint) may be utilized.
  • Who would benefit: Template authors who want to use new CSS properties. The same goes for Wikisource users who use Page styles.
  • More comments:
  • Phabricator tickets: phab:T322482, phab:T320322, phab:T277755 and others listed at https://phabricator.wikimedia.org/tag/css-sanitizer/
  • Proposer: Likibp (talk) 16:57, 31 January 2023 (UTC)[reply]

Discussion

  • I was just about to propose something like "update TemplateStyles CSS rules to current CSS spec versions". I don't want to sort-of duplicate this, but I feel a TemplateStyle request could be more ambitious - most of the time required from CommTech would be figuring out how the whole thing works, once you get that, adding one rule vs. several rules is not that huge a difference. The last update was three years ago, a bunch of CSS specs have changed since then. Some features have been requested explicitly, but the most maintainable (and most mindful of the sanity of the person who will update it the next time) would be to just select some CSS specification versions which are currently reasonable well-supported and then compare them to the versions currently used by TemplateStyles and apply all changes. CSS spec drafts usually come with a section explaining what changed compared to the previous version(e.g.) and implementing that will be a lot more manageable in the long term than cherry-picking and trying to keep track of what's in and what's out. --Tgr (talk) 01:29, 2 February 2023 (UTC)[reply]
  • @Likibp: We reviewed this proposal and before approving it we would like to ask you if you would like to update it to include "update TemplateStyles CSS rules to current CSS spec versions" as Tgr mentioned so that your proposal makes a bigger impact :). HMonroy (WMF) (talk) 22:11, 3 February 2023 (UTC)[reply]
    Yes, I would like to be updated on that proposal. Likibp (talk) 17:13, 5 February 2023 (UTC)[reply]
    Proposal updated.Likibp (talk) 13:17, 6 February 2023 (UTC)[reply]
  • Some things I think updating this library needs to think about in general, which I think the previous maintainer was pretty correct about: 1) accepting changes only from revisions that have reached a certain kind of published status (e.g. not editor's draft but instead candidate recommendation); 2) not just updating the set of documents supported in the library already but the set of documents that have have been created since the library was originally devised. Izno (talk) 07:41, 13 February 2023 (UTC)[reply]
    • Thanks for pointing that out. To a decent extent I was also guided by usage data (e.g. https://caniuse.com/): if there were high levels of browser support for something from a draft I'd be inclined to pull it in (particularly draft updates to an existing recommendation). And if a recommendation was published but hadn't been picked up by browsers for years, that was a negative sign. The other thing to keep in mind is the security aspect: any syntax allowing reference to an external resource needs to enforce filtering, which also means something like CSS Variables is difficult. Anomie (talk) 13:45, 14 February 2023 (UTC)[reply]

Voting