One of the biggest use-cases for CSS custom properties is theming. Let's consider that for a second. Perhaps you'd set some variables at the highes...
For further actions, you may consider blocking this person and/or reporting abuse
We're actually in the process of rolling out CSS variables on this site for the purpose of theming
[WIP] Theme-able CSS Variables #1377
I thought we ought to have a place where we keep a note of the current CSS Variables and also propose different variables that should be included.
Currently included:
--theme-background
#f9f9fa
--theme-top-bar-background
#fdf9f3
Pull request pending:
--theme-top-bar-color
#0a0a0a
--theme-top-bar-search-background
#e8e7e7
--theme-top-bar-search-color
#0a0a0a
Proposed:
--theme-color
#0a0a0a
--theme-container-background
#ffffff
--theme-container-color
#0a0a0a
I think the best thing to do is leave a comment below of further proposals and I will update the main post.
Also feel free to do pull requests to help roll these out.
If you'd like to contribute that would be greatly appreciated 🙂
Nice, I'm sure a lot of us would love a dark theme. I've been using the extension DarkReader at night, but it does not play nicely with dev.to so I've been waiting for a built-in option.
Custom properties look fairly straightforward to get started with. Your first example looks easy to implement for anyone familiar with CSS.
I'm glad to see that CSS is closing the gap with CSS preprocessors a little bit. Learning and configuring tools to transpile code can get a bit overwhelming at times.
very cool!
Good things and useful to know.....