TiddlyWiki / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
8.05k stars 1.19k forks source link

[IDEA] Apply :where() on all of the tiddlywiki styles to ensure the lowest specifity possible / avoid clash with user customisation #8591

Open Telumire opened 1 month ago

Telumire commented 1 month ago

The :where() pseudo-class is used in https://open-props.style/ , a CSS framework created by Adam Argyle. In this video, he explain why this is useful: https://youtube.com/clip/UgkxF9g6_f5DbO4jP26dUpN9gqpHzCS3XYqN?si=ktxEvM0ZEhBfisEc

In summary, this gives the selectors a specificity of 0; which means that they can be overridden very easily. Currently, caniuse indicate a global usage of 93.34%. The MDN doc mark this feature as "Baseline - Widely available : This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2021".

Is this support sufficient or should we wait a few years before using this feature ?

Jermolene commented 1 month ago

Hi @Telumire we generally leave it a bit longer before adopting a new feature of the web platform. For example, I think the latest JS features we use are from ECMAScript 2018. A big factor is whether the new feature allows graceful degradation. For example, a new CSS property that is not recognised by older browsers would not be considered a huge problem. But something like :where() would require TW's CSS to be rewritten in a way that would no longer work with older browsers.

Telumire commented 1 month ago

Hi @Jermolene, I apologize for bringing this up again—I now recall that there has been similar discussion in the past: https://github.com/TiddlyWiki/TiddlyWiki5/pull/8075#issuecomment-2013477881

Would it be possible to add a tiddler on TiddlyWiki.com to outline the official stance on CSS, JS, and HTML support? Perhaps something like: “Web platform features adopted by the core must have been released at least four years prior, except for progressive enhancements—features that enhance user experience while allowing graceful degradation if unsupported.”