Replies: 1 comment
-
CSS variables are applied to the actual DOM elements so yes you can use them across styles. As for exclusions, you can use a negative regexp lookahead. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I apologise if this has been answered before.. I tried to search before I posted, but I may not have the right terminology.
I'm trying to build a style that only applies if there are no other styles applied. So a sort of global default that works for any site that doesn't have a local style applied.
All of the "applies to" options in Stylus generally appear to be inclusive rather than exclusive ("match if", rather than "match except if"). Is there a way to detect that another style has been applied and prevent the global style from applying? (For instance, if I put a variable (
--style-present
, let's say) in:root
in each site-specific style, do those become cross-CSS accessible to Stylus after applying them? Could I then look for the presence of that variable and use it?)Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions