13 Star 67 Fork 77

金合科技/金合技术中台Web端

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
uno.config.ts 2.10 KB
一键复制 编辑 原始数据 按行查看 历史
LAPTOP-3PBLAHI8\8067 提交于 2024-04-16 18:14 . 修复已知bug
/*
* @Author : wfl
* @LastEditors : wfl
* @description :
* @updateInfo :
* @Date : 2024-03-14 11:00:23
* @LastEditTime : 2024-03-26 14:29:00
*/
import type { Theme } from 'unocss/preset-uno'
import {
defineConfig,
presetAttributify,
presetIcons,
presetTypography,
presetUno,
transformerCompileClass,
transformerDirectives,
transformerVariantGroup,
} from 'unocss'
import { entriesToCss, toArray } from '@unocss/core'
import themes from './themes'
export default defineConfig<Theme>({
content: {
pipeline: {
include: [
/\.(vue|svelte|[jt]sx|mdx?|astro|elm|php|phtml|html)($|\?)/,
'main-app/**/*.{js,ts}',
],
},
},
shortcuts: [
{
'flex-center': 'flex justify-center items-center',
'flex-col-center': 'flex flex-col justify-center items-center',
},
],
preflights: [
{
getCSS: () => {
const returnCss = []
Object.keys(themes).forEach((key) => {
const css = entriesToCss(Object.entries(themes[key]))
const roots = toArray(
themes[key]['color-scheme'] === 'light'
? [`[data-theme="${key}"],[data-theme="${key}"] *,[data-theme="${key}"] ::before,[data-theme="${key}"] ::after`, `[data-theme="${key}"] ::backdrop`]
: [`html.dark [data-theme="${key}"],html.dark [data-theme="${key}"] *,html.dark [data-theme="${key}"] ::before,html.dark [data-theme="${key}"] ::after`, `html.dark [data-theme="${key}"] ::backdrop`],
)
returnCss.push(roots.map(root => `${root}{${css}}`).join(''))
})
return returnCss.join('')
},
},
],
theme: {
colors: {
'ui-primary': 'rgb(var(--ui-primary))',
'ui-text': 'rgb(var(--ui-text))',
},
},
presets: [
presetUno(),
presetAttributify(),
presetIcons({
extraProperties: {
'display': 'inline-block',
'vertical-align': 'middle',
},
}),
presetTypography(),
],
transformers: [
transformerDirectives(),
transformerVariantGroup(),
transformerCompileClass(),
],
configDeps: [
'themes/index.ts',
],
})
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/ikingtech/iking-platform-web.git
git@gitee.com:ikingtech/iking-platform-web.git
ikingtech
iking-platform-web
金合技术中台Web端
dev

搜索帮助