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
Support for pseudo-selectors (ex, :hover) and pseudo-elements (ex, ::after) #14
Comments
|
I would love to try and take a look at it. |
Sounds good 👍 It might be a bit tricky, as what the plugin does is that instead of adding CSS to the DOM based on certain element conditions, it instead keeps track of all elements, and applies styles directly to them. This means that to have support for pseudo-selectors, it would need to add / remove event listeners as conditions change. If you want to give it a go, I can have a think of what the best solution would be, as it probably requires a refactor that either:
I have a gut-feeling the second option is probably the best one. |
Actually, using something like styletron to handle css applying based on style objects would be the easiest, since then we wouldn't need to come up with a way to apply styles for only certain elements ourselves. |
Thanks for the insights, I am currently examining the code and checking what can be done. Will keep your words in mind and update you with the results. |
Sure, no worries 👍 |
I am currently using the package in a project and it fits perfectly really. I've a valid use case for container query (or element query whatever people prefer to call it) and I was hit by the lack of support for the pseudo-classes 😆 and this is why I am seeing how to contribute 😄 |
Got it, thanks 👍 I thought someone would sooner or later want this feature. 😅 |
This would probably require a lot more thought put into it, but it should be possible to apply styles only on hover / focus etc events.
Example: Increasing font-size on hover.
The text was updated successfully, but these errors were encountered: