我和温德索斯有点问题。类不适用于元素。我试图安装一个旧版本的windi,但它仍然不能工作。我甚至尝试使用顺风而不是windi,但它仍然不起作用。
index.vue
<template>
<div>
<p class="text-red">e</p>
</div>
</template>windi.config.ts
import { defineConfig } from 'windicss/helpers'
export default defineConfig({
extract: {
include: ['**/*.{vue,html,jsx,tsx}'],
exclude: ['node_modules', '.git'],
},
theme: {
colors: {
primary: '#5b0770',
},
},
})发布于 2021-11-10 00:28:23
您正在使用当前配置覆盖所有颜色。
不是直接使用,而是在theme: {}中设置colors: {}
export default defineConfig({
...
theme: {
colors: {
primary: '#5b0770',
},
},考虑将colors: {}包装在extend: {}中的。
export default defineConfig({
...
theme: {
extend: {
colors: {
primary: '#5b0770',
},
},
},这将不会覆盖默认主题,而是扩展默认主题。
这同样适用于其他主题选项(fontFamily、screens等)
有关更多信息,请参阅windicss-docs。
https://stackoverflow.com/questions/69715111
复制相似问题