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

bugfix: exempt the :root psuedo-selector from the random css prefix #3250

Merged
merged 1 commit into from
Jul 23, 2019
Merged

bugfix: exempt the :root psuedo-selector from the random css prefix #3250

merged 1 commit into from
Jul 23, 2019

Conversation

davemo
Copy link
Contributor

@davemo davemo commented Jul 15, 2019

  • the change in :not(...) styles are broken #1705 introduced a small bug for users who were relying on assigning global CSS variables via the :root selector
  • this change adds a small exemption to avoid prefixing the :root pseudo-selector with the random prefix that svelte adds

here is a screenshot that illustrates the bug (pre 3.6.3 [working], post 3.6.3 [broken]), and the corresponding source in my App.svelte component file:

<style>
  :root {
    --unchecked-box: '\02610';
    --checked-box: '\02611';
    --snowman: '\02603';
  }
</style>

Screen Shot 2019-07-15 at 6 55 59 PM

- the change in #1705 introduced a small bug for users who were relying on assigning global CSS variables via the :root selector
- this change adds a small exemption to avoid prefixing :root with the random prefix that svelte adds
@davemo davemo changed the title bugfix: exempt the :root selector from prefix bugfix: exempt the :root psuedo-selector from the random css prefix Jul 15, 2019
@Rich-Harris Rich-Harris merged commit 8c1f48f into sveltejs:master Jul 23, 2019
@Rich-Harris
Copy link
Member

Thanks — the purist in me chafes at treating :root differently to other pseudo-classes, but the pragmatist can't see any reason you wouldn't want this behaviour

@davemo davemo deleted the fix/1705-root-pseudo-selector-prefix-exemption branch July 25, 2019 03:44
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

Successfully merging this pull request may close these issues.

2 participants