Skip to content
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

💡 RFC: Improving handling of :root in CSS (or warn users) #503

Closed
1 of 3 tasks
natemoo-re opened this issue Jun 21, 2021 · 1 comment
Closed
1 of 3 tasks

💡 RFC: Improving handling of :root in CSS (or warn users) #503

natemoo-re opened this issue Jun 21, 2021 · 1 comment

Comments

@natemoo-re
Copy link
Member

natemoo-re commented Jun 21, 2021

What is Missing from Astro Today?

I've noticed that quite a few people (myself included) have been tripped up when trying to write styles selecting :root. Our current suggestion is to use :global(:root), but is there a better solution here?

See the definition of :root in the CSS Selectors 4 Spec. Are there other pseudo-selectors that we need to consider?

https://discord.com/channels/830184174198718474/845451724738265138/856553773329154070

Proposed Solution

  • Improve our scoping logic to handle pseudo-selectors. Should selectors like :root never be scoped?
  • Warn users that they probably meant to use :global(:root)

Help Make it Happen!

  • I am willing to submit a PR to implement this change.
  • I am willing to submit a PR to implement this change, but would need some guidance (cc @drwpow)
  • I am not willing to submit a PR to implement this change.
@FredKSchott FredKSchott changed the title [Feature Request] Improving handling of :root in CSS (or warn users) 💡 RFC: Improving handling of :root in CSS (or warn users) Jun 30, 2021
@FredKSchott
Copy link
Member

Solved with the addition of <style global>. Should we add docs for this to make it clear?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants