-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
type definition errors on presetTheme #4
Comments
You also need to set the theme type for Please refer to the following |
Uhm... So i'm using unocss with nuxt 3 and my config lies in an How about you try using this preset with nuxt 3. Here's an example of my config. export default defineConfig({
theme: {},
presets: [
presetUno(),
presetAttributify(),
presetIcons({ scale: 1.2 }),
presetForms(),
presetTheme<Theme>({
theme: {
dark: {
colors: {
primary: "#1668dc",
"primary-border": "#1668dc",
border: "#424242"
}
}
}),
transformers: [transformerDirectives(), transformerVariantGroup()]
}) |
Just like this export default defineConfig<Theme>({...}) |
Works like a charm👌. Nice one So one more thing. I think it would be nice if the plugin could convert colors to rgba so as to respect a opacity when available. Currently when you pass in a color value(except for color names) to the color property in the default theme option of unocss, It's converted to rgba so if in usage, an opacity is passed, then it can be used. See examples below. DefaultNotice how the rgb color value passed to the color property in the config was converted rgba so it could respect opacity. With this presetNotice that it ignores the possibility of have opacity. I do hope that this is clear enough. Thanks |
Beautiful work @Dunqing. |
Tried using this plugin, but vscode keeps shouting at me about this
![image](https://user-images.githubusercontent.com/41494675/209556298-2757cb88-b3dc-4154-8f07-61f5d0affb54.png)
The text was updated successfully, but these errors were encountered: