You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Variables are undefined in legacy browsers when I declare variables that reference other variables. This might be a duplicate of #82 but there was no resolution there.
To create dark/light theming based on css variables, I am declaring scoped variables that reference root variables from a master set of design tokens. Here's an example of this concept to change background color by theme.
Per the limitations listed on the README and the docs:
Limitations
Custom property declaration support is limited to :root and :host rulesets
Scoped custom property declarations are (unfortunately) not supported. This has been covered in other issues, but the two that may be of interest are #26 (which explains why the polyfill doesn't support scoped custom properties) and #74 (specifically this comment which offers a solution for swapping themes).
Hope this helps. Happy to answer any questions you may have.
Variables are undefined in legacy browsers when I declare variables that reference other variables. This might be a duplicate of #82 but there was no resolution there.
To create dark/light theming based on css variables, I am declaring scoped variables that reference root variables from a master set of design tokens. Here's an example of this concept to change background color by theme.
Design token variables:
Scoped theme variables:
Stylesheet:
I've also created a more elaborate demo on CodePen: https://codepen.io/robdimarzo/pen/oNjKGXp
In Chrome:
In IE11:
The text was updated successfully, but these errors were encountered: