CSS custom properties issue
See original GitHub issuebody {
--theme-ui-colors-text: var(--theme-ui-colors-text, #495057);
/* --theme-ui-colors-text => undefined */
}
Maybe the right way
body {
--theme-ui-colors-text: #495057;
/* --theme-ui-colors-text => #495057 */
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:16 (15 by maintainers)
Top Results From Across the Web
Custom properties (--*): CSS variables - MDN Web Docs
Custom properties are scoped to the element(s) they are declared on, and participate in the cascade: the value of such a custom property...
Read more >The Issue with Preprocessing CSS Custom Properties
The transformation is not complete and cannot be (dynamic cascading variables based on custom properties relies on the DOM tree). It currently ...
Read more >using css custom properties variables not working
CSS custom properties are much more powerful than pre-processor ones, as they can be changed at runtime with javascript and be used in...
Read more >A Strategy Guide To CSS Custom Properties
Custom properties have the same rules about where they can be used as normal CSS properties. It's far better to think of them...
Read more >Support theming with CSS Custom Properties #4352 - GitHub
feature request Use CSS custom properties for at least color selection. What is the expected behaviour? To be able to alter the color-scheme...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey!
If I understand correctly, it’s intended for the CSS variables to not be used directly by us. However, shouldn’t we allow this option (converting all theme props to CSS Variables and inserting in page)?
I arrived here after trying to style common elements like
<h1>
,<h2>
,<strong>
,<a>
according to the theme and then just use them directly in the page. Later, when a 3rd party app embeds our code, it will change some part of the theme, but since it’s CSS Variables these elements will update as well.I hacked together this adapter which allow dynamic insertion of CSS Variables. (just colors for now)
Although this wasn’t hard, I wonder whether this option should be present by default.
Closing this because the internal custom properties implementation will be changing slightly in v0.3