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

:not(...) styles are broken #1705

Closed
Rich-Harris opened this issue Aug 28, 2018 · 5 comments · Fixed by #3141
Closed

:not(...) styles are broken #1705

Rich-Harris opened this issue Aug 28, 2018 · 5 comments · Fixed by #3141
Labels

Comments

@Rich-Harris
Copy link
Member

REPL. The encapsulator should treat :not(selector) as *:not(selector), but it doesn't.

@thollander
Copy link
Contributor

I don't think it is a svelte bug.
This is the normal behaviour in CSS.
See this codepen : https://codepen.io/thollander/pen/JzJQKO?editors=1100

The color is inherited by default.
https://www.w3schools.com/cssref/pr_text_color.asp
So it takes the color of the body property which validates the rule :not(p)
However, in the example, you can see border hasn't the same behaviour.

@Rich-Harris
Copy link
Member Author

Updated REPL that shows the bug better: https://svelte.dev/repl/3c70b1effcf4442a8280b1c5db8c6f10?version=3.6.2

:not(xxx) should be converted to .svelte-xyz123:not(xxx)

Rich-Harris added a commit that referenced this issue Jul 1, 2019
add scoping attribute for pseudo-class selectors without a type/class
@Rich-Harris
Copy link
Member Author

Fixed in 3.6.3

@rob-balfre
Copy link
Contributor

rob-balfre commented Jul 12, 2019

@Rich-Harris I'm guessing this change is what is caused my :root css variables to stop working in Svelte 3.6.3+?

https://svelte.dev/repl/9a0c0ca1518346c9aa117d6f6b905fc9?version=3.6.2 (working)
https://svelte.dev/repl/9a0c0ca1518346c9aa117d6f6b905fc9?version=3.6.3 (not working)

Changing :root to :global(body) is my current work around, just checking this is the desired outcome for this change?
https://svelte.dev/repl/9b6f314ecb0145b1b63451435c489402?version=3.6.3 (work around)

@davemo
Copy link
Contributor

davemo commented Jul 15, 2019

@rob-balfre I can confirm this is broken as I was also using :root selectors for variables, good to see there's a workaround but I suspect the fix should be to avoid prefixing the :root pseudo-selector -- I have a PR coming with a fix.

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

Successfully merging a pull request may close this issue.

4 participants