-
Notifications
You must be signed in to change notification settings - Fork 795
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
bug: Scoped CSS classnames wrongly escaped #3083
Comments
Someone had previously reported this on the Tailwind repo: tailwindlabs/tailwindcss#1985 |
@splitinfinities I've validated this bug, but set the |
Is this closable? |
This bug should be closable now with the release of v2.11.0 of Stencil, which happened ~30 minutes ago. Should anyone find a new instance of it (this bug), please open a new issue! |
Prequisites
Stencil Version
v2.8.1
Current Behavior
When using
scoped: true
on a component, CSS class names with special characters are mangled due to incorrect escaping. This is particularly obvious when using a framework like Tailwind, which makes extensive use of special characters (:
) in class names.Expected Behavior
When using selectors in CSS like
.foo\:bar
the scoped selector in JS should be in the format.scopeName.foo\:bar
.Instead we currently get
.foo\.scopeName:bar
, which won't match anything.Steps to Reproduce
Create a CSS file with a classname using escaped special characters:
Use the class in a component that has
scoped: true
:Code Reproduction URL
https://github.com/nemzes/stencil-scoped-classes-bug
Additional Information
Specifically for Tailwind, it is possible to work around this bug by using the
separator
configuration to use a character that doesn't require escaping (e.g. "_
"): https://tailwindcss.com/docs/configuration#separatorThe text was updated successfully, but these errors were encountered: