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

fix: escape , properly #941

Merged
merged 2 commits into from May 7, 2022
Merged

fix: escape , properly #941

merged 2 commits into from May 7, 2022

Conversation

alexanderniebuhr
Copy link
Collaborator

@alexanderniebuhr alexanderniebuhr commented May 5, 2022

This PR updates the escape char of , to be \, instead of \2c . I suggest this change because using uno with svelte scoping breaks. Svelte removes unused styles (if scoped), and does not recognise the \2c as the same class in the markup.

I tested the browser support (using online test grids) for the example of grid-cols-[repeat(6,1fr)]

Desktop (https://github.com/alexanderniebuhr/lambda-test/blob/main/TES100201621651772638589250.pdf)

  • Chrome >59 ✅
  • Firefox >58 ✅
  • IE 11 ❌
  • Safari >12 ✅

Mobile (https://github.com/alexanderniebuhr/lambda-test/blob/main/TES100201621651774781769360.pdf)

  • iPhones
  • multiple Android Phones

Everything seems to work, except IE. But the browser does not support grid, so I expect that. However IE should work with supported rules with , in them.

According to newest brower's dev tools, the generated css class is the same with both escape chars (see attached screenshot).

Screenshot 2022-05-05 at 20 03 43

closes #939

@netlify
Copy link

netlify bot commented May 5, 2022

Deploy Preview for unocss canceled.

Name Link
🔨 Latest commit 8e719d7
🔍 Latest deploy log https://app.netlify.com/sites/unocss/deploys/6274143b9ceb92000b4a3aad

@alexanderniebuhr alexanderniebuhr changed the title WIP fix: 🐛 comma escape char breaks svelte scoping fix: 🐛 comma escape char breaks svelte scoping May 5, 2022
@alexanderniebuhr alexanderniebuhr marked this pull request as ready for review May 5, 2022 18:41
@alexanderniebuhr
Copy link
Collaborator Author

I am more than happy to do some more test, if requested with some test items.

@antfu antfu changed the title fix: 🐛 comma escape char breaks svelte scoping fix: escape , properly May 5, 2022
@antfu antfu merged commit d337ce4 into main May 7, 2022
@antfu antfu deleted the alexanderniebuhr/improve-escape branch May 7, 2022 06:00
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.

, escape breaks svelte scoping
2 participants