Skip to content

Commit

Permalink
add note to docs about theme(), @screen support
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-8 committed May 31, 2023
1 parent 9c080f4 commit 35dee83
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/integrations/svelte-scoped.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ will be transformed into:

In order for `rtl:ml-2` to work properly, the `[dir="rtl"]` selector is wrapped with `:global()` to keep the Svelte compiler from stripping it out automatically as the component has no element with that attribute. However, `div` can't be included in the `:global()` wrapper because that style would then affect every `div` in your app.

### Other style block directives

Using [theme()](https://unocss.dev/transformers/directives#theme) is also supported, but [@screen](https://unocss.dev/transformers/directives#screen) is **not**.

## Vite Plugin

In Svelte or SvelteKit apps, inject generated styles directly into your Svelte components, while placing the minimum necessary styles in a global stylesheet. Check out the [SvelteKit example](https://github.com/unocss/unocss/tree/main/examples/sveltekit-scoped) in Stackblitz:
Expand Down

0 comments on commit 35dee83

Please sign in to comment.