Closed songpeng154 closed 2 months ago
webstorm 版本2024.2.0.1 vite 5.4.1
输入flex有提示吗
有了
咋关了?
这不是好了吗?有什么问题
我uno.config.ts中自定义的字体颜色、背景颜色、边框没有代码提示
你这配置就是错的吧,看看官方的文档 https://unocss.dev/config/theme
就算改成extendTheme
的方式,也不行啊,官方也没说只能自定义colors
// uno.config.ts
import { defineConfig, presetUno, transformerDirectives } from 'unocss'
import { Theme } from '@unocss/preset-uno'
export default defineConfig<Theme>({
content: {
pipeline: {
exclude: [ 'node_modules', 'dist' ],
}
},
transformers: [
transformerDirectives()
],
presets: [
presetUno(),
],
extendTheme: (theme)=>{
return {
...theme,
colors: {
...theme.colors,
'primary': 'red',
},
textColor: {
...theme.textColor,
'main': 'red',
},
backgroundColor: {
...theme.backgroundColor,
'main': '#445cdc',
},
borderColor: {
...theme.borderColor,
'main': 'red',
},
}
},
})
这是手动输入的bg-main
,没有代码提示,有颜色提示
你可以自己试试
我也不清楚,上游unocss服务没返回
背景颜色、字体颜色、边框颜色都没有代码提示,只有colors有代码提示