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(svelte-scoped): handle expressions in class attribute correctly #2505

Merged
merged 1 commit into from Apr 15, 2023

Conversation

devunt
Copy link
Contributor

@devunt devunt commented Apr 15, 2023

Fixes #2504.

Corresponding tests are also added.

Now UnoCSS correctly transforms

<div class={clsx(flag && "text-red-500")}>This should be red</div>

into

<div class={clsx(flag && "uno-3as8ej")}>This should be red</div>

in the svelte-scoped mode.

@devunt devunt requested a review from antfu as a code owner April 15, 2023 05:57
@netlify
Copy link

netlify bot commented Apr 15, 2023

Deploy Preview for unocss ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 5cc20c0
🔍 Latest deploy log https://app.netlify.com/sites/unocss/deploys/643a3cb1800e4c0008b82da7
😎 Deploy Preview https://deploy-preview-2505--unocss.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@antfu antfu merged commit 52327b8 into unocss:main Apr 15, 2023
10 checks passed
@devunt devunt deleted the svelte-scoped branch April 15, 2023 08:56
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.

Expressions in class does not get extracted in svelte-scoped mode
2 participants