Skip to content

feat(svelte-scoped): add hashSafelistClasses boolean, by default do not hash safelisted classes#5157

Merged
zyyv merged 2 commits intounocss:mainfrom
henrikvilhelmberglund:fix-sveltescoped-safelist-shortcut
Apr 7, 2026
Merged

feat(svelte-scoped): add hashSafelistClasses boolean, by default do not hash safelisted classes#5157
zyyv merged 2 commits intounocss:mainfrom
henrikvilhelmberglund:fix-sveltescoped-safelist-shortcut

Conversation

@henrikvilhelmberglund
Copy link
Copy Markdown
Contributor

A bit unsure whether this is a new feature or a bug fix, calling it a feature for now.

This PR adds hashSafelistClasses (default false) in the Svelte-scoped config which now by default removes hashing of safelisted classes making it easier to use with classes that need to have specific names such as third party CSS. Note that this will make the names of safelisted classes very obvious in production.

Previous behavior: Hash classes that are safelisted (may cause issues with third party CSS/animations)
New behavior: Don't hash classes that are safelisted (could be better when integrating with other CSS)

If the previous behavior is needed set hashSafelistClasses to true. I didn't touch the code for the previous behavior.

fix #5154

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 18, 2026

Deploy Preview for unocss ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit e080bf6
🔍 Latest deploy log https://app.netlify.com/projects/unocss/deploys/69baf415e3fdd20008b6e32a
😎 Deploy Preview https://deploy-preview-5157--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 project configuration.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 18, 2026

Open in StackBlitz

commit: e080bf6

@zyyv zyyv added this pull request to the merge queue Apr 7, 2026
Merged via the queue into unocss:main with commit e5f8946 Apr 7, 2026
11 checks passed
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.

safelist does not work for shortcuts in @unocss/svelte-scoped

2 participants