Skip to content

remove :where for Svelte 5 compatibility #12

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zeroberry
Copy link

In Svelte 5, the CSS scoping strategy has changed. Previously, scoped styles were compiled as .xyz123:where(.class), but now they're compiled as :where(.class.xyz123). This change affects selector specificity:

  • Before: .s-_ijnsPqesdMQ:where(._jsonList) = specificity (0,0,1,0)
  • Svelte 5: :where(._jsonList.s-_ijnsPqesdMQ) = specificity (0,0,0,0)

Now the component styles can be too easily overridden by any other CSS rules, including common CSS reset utilities like

ul {
  padding: 0;
  border: 0;
}

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.

1 participant