OOPS!
diff --git a/src/views/redirect/index.vue b/src/views/redirect/index.vue
index 9951b21..9a1288a 100644
--- a/src/views/redirect/index.vue
+++ b/src/views/redirect/index.vue
@@ -3,7 +3,7 @@
diff --git a/stylelint.config.js b/stylelint.config.js
index 2e16401..03d3ff5 100644
--- a/stylelint.config.js
+++ b/stylelint.config.js
@@ -1,51 +1,51 @@
module.exports = {
- // 继承推荐规范配置
- extends: [
- 'stylelint-config-standard',
- 'stylelint-config-recommended-scss',
- 'stylelint-config-recommended-vue/scss',
- 'stylelint-config-html/vue',
- 'stylelint-config-recess-order',
- ],
- // 指定不同文件对应的解析器
- overrides: [
- {
- files: ['**/*.{vue,html}'],
- customSyntax: 'postcss-html',
- },
- {
- files: ['**/*.{css,scss}'],
- customSyntax: 'postcss-scss',
- },
- ],
- // 自定义规则
- rules: {
- 'import-notation': 'string', // 指定导入CSS文件的方式("string"|"url")
- 'selector-class-pattern': null, // 选择器类名命名规则
- 'custom-property-pattern': null, // 自定义属性命名规则
- 'keyframes-name-pattern': null, // 动画帧节点样式命名规则
- 'no-descending-specificity': null, // 允许无降序特异性
- 'no-empty-source': null, // 允许空样式
- // 允许 global 、export 、deep伪类
- 'selector-pseudo-class-no-unknown': [
- true,
- {
- ignorePseudoClasses: ['global', 'export', 'deep'],
- },
- ],
- // 允许未知属性
- 'property-no-unknown': [
- true,
- {
- ignoreProperties: [],
- },
- ],
- // 允许未知规则
- 'at-rule-no-unknown': [
- true,
- {
- ignoreAtRules: ['apply', 'use', 'forward'],
- },
- ],
- },
+ // 继承推荐规范配置
+ extends: [
+ 'stylelint-config-standard',
+ 'stylelint-config-recommended-scss',
+ 'stylelint-config-recommended-vue/scss',
+ 'stylelint-config-html/vue',
+ 'stylelint-config-recess-order',
+ ],
+ // 指定不同文件对应的解析器
+ overrides: [
+ {
+ files: ['**/*.{vue,html}'],
+ customSyntax: 'postcss-html',
+ },
+ {
+ files: ['**/*.{css,scss}'],
+ customSyntax: 'postcss-scss',
+ },
+ ],
+ // 自定义规则
+ rules: {
+ 'import-notation': 'string', // 指定导入CSS文件的方式("string"|"url")
+ 'selector-class-pattern': null, // 选择器类名命名规则
+ 'custom-property-pattern': null, // 自定义属性命名规则
+ 'keyframes-name-pattern': null, // 动画帧节点样式命名规则
+ 'no-descending-specificity': null, // 允许无降序特异性
+ 'no-empty-source': null, // 允许空样式
+ // 允许 global 、export 、deep伪类
+ 'selector-pseudo-class-no-unknown': [
+ true,
+ {
+ ignorePseudoClasses: ['global', 'export', 'deep'],
+ },
+ ],
+ // 允许未知属性
+ 'property-no-unknown': [
+ true,
+ {
+ ignoreProperties: [],
+ },
+ ],
+ // 允许未知规则
+ 'at-rule-no-unknown': [
+ true,
+ {
+ ignoreAtRules: ['apply', 'use', 'forward'],
+ },
+ ],
+ },
};
diff --git a/uno.config.ts b/uno.config.ts
index 2ba0311..3c89a86 100644
--- a/uno.config.ts
+++ b/uno.config.ts
@@ -7,18 +7,22 @@ import {
presetWebFonts,
transformerDirectives,
transformerVariantGroup,
-} from "unocss";
+} from 'unocss';
export default defineConfig({
shortcuts: {
- "flex-center": "flex justify-center items-center",
- "flex-x-between": "flex items-center justify-between",
- "flex-x-around": "flex items-center justify-around",
- "flex-y-center": "flex flex-col flex-wrap justify-center items-center",
+ 'flex-center': 'flex justify-center items-center',
+ 'flex-x-between': 'flex items-center justify-between',
+ 'flex-x-around': 'flex items-center justify-around',
+ 'flex-y-center': 'flex flex-col flex-wrap justify-center items-center',
+ 'flex-y-between': 'flex flex-col flex-wrap justify-between items-center',
},
theme: {
colors: {
- // ...
+ primary: '#027AFF',
+ 'primary-secondary': '#00FFFF',
+ warning: '#FFBE44',
+ 'warning-secondary': '#FEDB65',
},
},
presets: [
diff --git a/vite.config.ts b/vite.config.ts
index 893cdab..4479b11 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -1,16 +1,17 @@
-import { defineConfig } from "vite";
-import { plugins } from "./build/plugins";
-import { resolve } from "./build/resolve";
-import { buildEnv } from "./build/buildEnv";
-import { define } from "./build/define";
-import { root, wrapperEnv } from "./build/utils";
-import { server } from "./build/server";
-import { exclude, include } from "./build/optimize";
-import postCssPxToViewport8plugin from "postcss-px-to-viewport-8-plugin";
+import { defineConfig } from 'vite';
+
+import { buildEnv } from './build/buildEnv';
+import { css } from './build/css';
+import { define } from './build/define';
+import { exclude, include } from './build/optimize';
+import { plugins } from './build/plugins';
+import { resolve } from './build/resolve';
+import { server } from './build/server';
+import { root, wrapperEnv } from './build/utils';
// https://vite.dev/config/
export default defineConfig(({ command, mode, isSsrBuild, isPreview }) => {
- const env = wrapperEnv(mode, "VITE");
+ const env = wrapperEnv(mode, 'VITE');
return {
root,
@@ -19,34 +20,12 @@ export default defineConfig(({ command, mode, isSsrBuild, isPreview }) => {
plugins: plugins(mode),
resolve: resolve(),
esbuild: {
- jsxFactory: "h",
- jsxFragment: "Fragment",
+ jsxFactory: 'h',
+ jsxFragment: 'Fragment',
jsxInject: "import { h } from 'vue';",
},
- css: {
- postcss: {
- plugins: [
- postCssPxToViewport8plugin({
- unitToConvert: "px",
- viewportWidth: 1920, // 设计稿的宽度
- unitPrecision: 5, // 单位转换后保留的精度
- propList: ["*"], // 能转化为vw的属性列表
- viewportUnit: "vw", // 希望使用的视口单位
- fontViewportUnit: "vw", // 字体使用的视口单位
- selectorBlackList: [], // 需要忽略的CSS选择器,不会转为视口单位,使用原有的px等单位。
- minPixelValue: 1, // 设置最小的转换数值,如果为1的话,只有大于1的值会被转换
- mediaQuery: true, // 媒体查询里的单位是否需要转换单位
- replace: true, // 是否直接更换属性值,而不添加备用属性
- exclude: [/node_modules/], // 忽略某些文件夹下的文件或特定文件,例如 'node_modules' 下的文件
- include: [], // 如果设置了include,那将只有匹配到的文件才会被转换
- landscape: false, // 是否添加根据 landscapeWidth 生成的媒体查询条件 @media (orientation: landscape)
- landscapeUnit: "vw", // 横屏时使用的单位
- landscapeWidth: 1024, // 横屏时使用的视口宽度
- }),
- ],
- },
- },
- logLevel: "info",
+ logLevel: 'info',
+ css: css(mode),
// 设为 false 可以避免 Vite 清屏而错过在终端中打印某些关键信息
clearScreen: false,
build: buildEnv(),