diff --git a/README.md b/README.md index ff46b60..4367183 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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/) diff --git a/src/index.ts b/src/index.ts index 73b1d60..2b8b75a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -152,7 +152,7 @@ export function presetTheme>(options: PresetThemeO return { matcher, selector(input) { - const themeName = input.match(/\:([\w-]+)\\\:\d+/)![1] + const themeName = input.match(/:([\w-]+)\\:\d+/)![1] return selectors[themeName] || `.${themeName}` }, }