You’ve shared SASS sources to make writing custom user styles easier. While this is awesome, it works only for the theme kind of user styles. Any user styles which rearrange elements and any user scripts which add new elements would benefit from being able to read the current values, in order to make rearranged and new elements match the rest of the page’s style.
Suggestion #1 (simple part)
Export common SASS variables to custom CSS properties aka variables so that $background_color: #ffffff !default;
in SASS becomes --background-color: #ffffff;
in :root
in CSS.
Suggestion #2 (optional hard part)
If you not only export CSS variables but switch to using them when assigning values to normal properties, any theming user styles will be ten times simpler and future-proof. Instead of generating the whole CSS, all they would need is to modify the CSS variables.
This can be seen on modern YouTube, for example. To change link text color, all I need is to set :root { --yt-endpoint-color: red !important; }
. If a user script adds an element, it can style it by using background: var(--yt-app-background)
. This makes user styles and user scripts much more reliable, compatible with each other and future-proof.
However, CSS variables have only recently been added to Edge, so switching to their usage over SASS variables may be a bit too early, just a future plan if you want to gain the benefits of CSS variables.
St
SyaN Help fund the $15 daily operational cost of Derpibooru - support us financially!