Commit c77f7e62aba51072325dffdb01d3c0cc87c578b0

Authored by Vben
1 parent 640a2c17

fix(theme): make sure the menu style is correct, fix #382

build/config/themeConfig.ts
... ... @@ -49,6 +49,8 @@ export function generateColors({
49 49 .toRgbString();
50 50 });
51 51  
  52 + const shortAlphaColors = alphaColors.map((item) => item.replace(/\s/g, '').replace(/0\./g, '.'));
  53 +
52 54 const tinycolorLightens = arr
53 55 .map((_t, i) => {
54 56 return tinycolor(color)
... ... @@ -64,5 +66,12 @@ export function generateColors({
64 66 .toHexString();
65 67 })
66 68 .filter((item) => item !== '#000000');
67   - return [...lightens, ...darkens, ...alphaColors, ...tinycolorDarkens, ...tinycolorLightens];
  69 + return [
  70 + ...lightens,
  71 + ...darkens,
  72 + ...alphaColors,
  73 + ...shortAlphaColors,
  74 + ...tinycolorDarkens,
  75 + ...tinycolorLightens,
  76 + ].filter((item) => !item.includes('-'));
68 77 }
... ...
package.json
... ... @@ -113,7 +113,7 @@
113 113 "vite-plugin-pwa": "^0.7.0",
114 114 "vite-plugin-style-import": "^0.9.2",
115 115 "vite-plugin-svg-icons": "^0.4.1",
116   - "vite-plugin-theme": "^0.6.3",
  116 + "vite-plugin-theme": "^0.6.4",
117 117 "vite-plugin-windicss": "0.13.2",
118 118 "vue-eslint-parser": "^7.6.0"
119 119 },
... ...
yarn.lock
... ... @@ -9112,10 +9112,10 @@ vite-plugin-svg-icons@^0.4.1:
9112 9112 svg-baker "1.7.0"
9113 9113 svgo "^2.3.0"
9114 9114  
9115   -vite-plugin-theme@^0.6.3:
9116   - version "0.6.3"
9117   - resolved "https://registry.npmjs.org/vite-plugin-theme/-/vite-plugin-theme-0.6.3.tgz#77be00b039eb53452c9adfce7fd90e39a39a81ee"
9118   - integrity sha512-ffhnqCtCG/0Y7egfiF9upJRo5ZEKS6lQOQsSztqu8gA2/SGsNTm3lsmEWvARMeUAj/8aF5PYzAv5EikfhcPENQ==
  9115 +vite-plugin-theme@^0.6.4:
  9116 + version "0.6.4"
  9117 + resolved "https://registry.npmjs.org/vite-plugin-theme/-/vite-plugin-theme-0.6.4.tgz#51376c328d708aa30ce56031ff4d7dd02cca613f"
  9118 + integrity sha512-GoXSDHjmDNU2R6bmuyr67VqI5dekGSejNMzlGTivMOmNl516464ATmV5NtoCDNiPJ1QYYnMRjZSQNfZ/Fxl7Qg==
9119 9119 dependencies:
9120 9120 "@types/node" "^14.14.37"
9121 9121 "@types/tinycolor2" "^1.4.2"
... ...