-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop :root limitation using new selector/rules injections ? #30
Comments
It's impossible to make it work like native css vars would. Non- |
I know we can't guess the dom, that's why i was mentionning the possibility to inject all possibilities under selectors that are defining non root custom prop. This may sound brutal indeed but I dont understand why this will be not enough. |
Because there are too many possibilities. What about nested components each with their own local variable overrides? It's not something we can get right outside of the DOM tree. Even if we could, it would be a nightmare to debug this kind of thing. |
Agreed. It's theoretically possible to do this, and might even be plausible if you only override a given variable in one place, but the number of rules necessary scales at least as fast as (number of places setting the var)*(number of places using the var). I think it actually goes combinatorial on one of those factors, but I don't want to think it through. ^_^ |
Like said here I was that dropping :root limitation should be that hard using selector injection like it has been already said in other issues. This could also fix #17
I would expect
Not sure about what I'm missing. I know we cant guess dom & so update appropriate result, but we could inject new selectors with rules that make use of var() like in the example above.
Obviously that can represent a huge amount of selectors to add if there is a lot of variable & a lot of usage, but that will do the job "as expected".
I was thinking of an incoming issue with #id selectors related to injection but can't remind it right now it's too early in the morning here.
The text was updated successfully, but these errors were encountered: