Comments (5)
Beautiful work @Dunqing.
from unocss-preset-theme.
You also need to set the theme type for unocss
Please refer to the following
https://github.com/Dunqing/unocss-preset-theme/blob/f2419617670bdcb5eb12b4b4850e2af49418ec75/playground/vite.config.ts#L10
from unocss-preset-theme.
Uhm... So i'm using unocss with nuxt 3 and my config lies in an unocss.config.ts
file not in vite.config.ts. This means that the unocss export from vite is not needed. So how do I then use this preset?
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()]
})
from unocss-preset-theme.
Just like this
export default defineConfig<Theme>({...})
from unocss-preset-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.
Default
Notice how the rgb color value passed to the color property in the config was converted rgba so it could respect opacity.
With this preset
Notice that it ignores the possibility of have opacity.
I do hope that this is clear enough. Thanks
from unocss-preset-theme.
Related Issues (20)
- cannot use with hsl colors from v4
- Not worked with 'dark' or 'light' class on html attribute HOT 2
- Dependency Dashboard
- Please if possible add a check for UnoCSS version when installing unocss-preset-theme HOT 1
- Wrong Generated Variables HOT 11
- Support [email protected] HOT 2
- Typescript Issues HOT 1
- Apply theme based on media query HOT 5
- Not working, theme values directly applied HOT 3
- v0.9.0 generates wrong CSS HOT 4
- v0.9.1 generates wrong css? HOT 6
- border color variables doesnt work HOT 2
- Typescript error in config HOT 4
- Dark color variables used but not defined HOT 1
- Incorrect CSS color generated in the latest unocss HOT 1
- 【Feature】Skip the load on demand detection and generate all variables HOT 1
- media query in config `safelist` got wrong output `:root` css
- @unocss/core必须使用0.49.8吗 HOT 4
- type definition errors on presetTheme HOT 4
- unocss-preset-theme not playing nice with svelte-preprocess "external files" HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unocss-preset-theme.