You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
870 B
JavaScript

2 months ago
import { defineConfig, presetUno,presetWind , presetAttributify, presetIcons } from 'unocss'
2 months ago
const parseStyle = (style) => {
const [key, value] = style.split(':');
return { [key.trim()]: value.trim() };
};
2 months ago
export default defineConfig({
presets: [
presetWind(), // 使用默认的 UnoCSS 预设
presetIcons()
],
2 months ago
theme: {
colors: {
primary: '#2B69A1', // 自定义主色
secondary: '#9333EA', // 自定义副色
accent: '#F59E0B', // 自定义强调色
// 你可以继续添加更多颜色
}
},
rules: [
// 处理 focus 伪类
[/^focus:(.*)$/, ([, style]) => ({ ':focus': { ...parseStyle(style) } })],
// 处理 placeholder 伪元素
[/^placeholder:(.*)$/, ([, style]) => ({ '::placeholder': { ...parseStyle(style) } })],
],
2 months ago
})