Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
update notes
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-8 committed Mar 30, 2023
1 parent 76f1180 commit 9a77472
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/svelte-preprocess-unocss/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Patch Changes

- fix: --at-apply works again
- fix: include @unocss/preset-icons as dependency to make icons work
- Updated dependencies
- svelte-scoped-uno@0.0.3
Expand Down
18 changes: 17 additions & 1 deletion packages/svelte-preprocess-unocss/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,20 @@ export default defineConfig({
})
```

All exports from `unocss` are reexported from `svelte-preprocess-unocss` so there's no need to install `unocss`. This will avoid any breaking changes from unocss affecting your project.
All exports from `unocss` are re-exported from `svelte-preprocess-unocss` so there's no need to install `unocss`. This will avoid any breaking changes from unocss affecting your project.

## Known Issues

Don't use `--at-apply` on classes that need global scoping like `dark:___` as the .dark selector will be placed outside the global selector. For example, this will NOT work:

```css
:global(.my-box) {
--at-apply: dark:bg-red-700;
}
```

Instead just apply the class directly, like this:

```html
<div class="dark:bg-red-700"></div>
```
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

<style>
button {
--at-apply: bg-red-100 hover:bg-red-200 p-3 rounded
--at-apply: bg-red-100 hover:bg-red-200 p-3 rounded;
}
:global(.classes-needing-global-context-must-use-global-to-avoid-being-stripped-out-by-consuming-library) {
--at-apply: dark:bg-red-700 dark:hover:bg-red-600
--at-apply: dark:bg-red-700 dark:hover:bg-red-600;
}
</style>

0 comments on commit 9a77472

Please sign in to comment.