Skip to content

Commit

Permalink
chore: fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunqing committed Jul 1, 2024
1 parent fe43ca6 commit 1b6d214
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ This preset will help you easily make dynamic theme switching. Inspired by [here
npm i -D unocss-preset-theme
```


## Usages

Usually you just need to set your `light theme` to `unocss` and your `dark theme` to `presetTheme`. This preset will transform your provide theme into css variables, then you just need to set the `dark` class or `compact` class (Depends on your theme name) in your html and you're done.
Expand Down Expand Up @@ -82,7 +81,6 @@ Your different theme. like `{ dark: {}, other: {} }`

Customize the selectors of the generated css variables `{ light: ':root', [themeName]: '.[themeName]' }`


## Examples

- [playground](./playground/)
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export function presetTheme<T extends Record<string, any>>(options: PresetThemeO
return {
matcher,
selector(input) {
const themeName = input.match(/\:([\w-]+)\\\:\d+/)![1]
const themeName = input.match(/:([\w-]+)\\:\d+/)![1]
return selectors[themeName] || `.${themeName}`
},
}
Expand Down

0 comments on commit 1b6d214

Please sign in to comment.