From 92134f7801a5d3422f23ff2f49b18f1ff4a73e3c Mon Sep 17 00:00:00 2001 From: 07akioni <07akioni2@gmail.com> Date: Sun, 26 Sep 2021 01:30:26 +0800 Subject: [PATCH] fix(select): global theme overrides not working for select trigger, closes #1229 --- CHANGELOG.en-US.md | 7 ++++--- CHANGELOG.zh-CN.md | 7 ++++--- package.json | 2 +- src/_internal/selection/styles/_common.ts | 8 -------- src/_internal/selection/styles/dark.ts | 20 ++++++++++++++++++-- src/_internal/selection/styles/light.ts | 20 ++++++++++++++++++-- 6 files changed, 45 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 27509d086..d43982dae 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -2,17 +2,18 @@ ## Pending -### Localization +### i18n - Add ukUA locale. ### Fixes - Fix `n-global-style` applies style transition on first mount. -- Fix `n-drawer` border transition, closes[#1211]. +- Fix `n-drawer` border transition, closes [#1211](https://github.com/TuSimple/naive-ui/issues/1211). - Fix `n-input-number`'s `value` prop can't be `null` type. - Fix components with rtl support throws error in SSR. - Fix components with popover throws error in SSR. +- Fix global theme overrides not working for `n-select` trigger, closes [#1229](https://github.com/TuSimple/naive-ui/issues/1229). ### Feats @@ -1124,7 +1125,7 @@ See vue3.md - Add `n-space` component. - Make `n-drawer` content scrollable. -### Localization +### i18n - Add zhCN for `n-log` diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index d2b5fff25..943c7116f 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -2,17 +2,18 @@ ## Pending -### Localization +### i18n - 新增 ukUA locale ### Fixes - 修复 `n-global-style` 在首次挂载时应用样式过渡 -- 修复 `n-drawer` 边界缺少 transition,关闭 [#1211] +- 修复 `n-drawer` 边界缺少 transition,关闭 [#1211](https://github.com/TuSimple/naive-ui/issues/1211) - 修复 `n-input-number` 的 `value` 属性不能为 null 类型 - 修复支持 rtl 的组件 SSR 报错 - 修复有弹出层组件的 SSR 报错 +- 修复全局样式覆盖对 select 触发器不生效,关闭 [#1229](https://github.com/TuSimple/naive-ui/issues/1229) ### Feats @@ -1125,7 +1126,7 @@ - 增加 `n-space` 组件 - `n-drawer` 内容可滚动 -### Localization +### i18n - `n-log` 添加 zhCN 本地化 diff --git a/package.json b/package.json index 39467b3b0..5f7678c6d 100644 --- a/package.json +++ b/package.json @@ -134,7 +134,7 @@ "vdirs": "^0.1.4", "vfonts": "^0.1.0", "vooks": "^0.2.6", - "vueuc": "^0.4.9" + "vueuc": "^0.4.12" }, "sideEffects": false, "homepage": "https://www.naiveui.com", diff --git a/src/_internal/selection/styles/_common.ts b/src/_internal/selection/styles/_common.ts index 4f2da1f3f..604177684 100644 --- a/src/_internal/selection/styles/_common.ts +++ b/src/_internal/selection/styles/_common.ts @@ -1,12 +1,4 @@ export default { - heightTiny: '22px', - heightSmall: '28px', - heightMedium: '34px', - heightLarge: '40px', - fontSizeTiny: '12px', - fontSizeSmall: '14px', - fontSizeMedium: '14px', - fontSizeLarge: '15px', paddingSingle: '0 26px 0 14px', clearSize: '16px', arrowSize: '16px' diff --git a/src/_internal/selection/styles/dark.ts b/src/_internal/selection/styles/dark.ts index 9f8153729..da4a975b3 100644 --- a/src/_internal/selection/styles/dark.ts +++ b/src/_internal/selection/styles/dark.ts @@ -29,11 +29,27 @@ const internalSelectionDark: InternalSelectionTheme = { clearColorHover, clearColorPressed, placeholderColor, - placeholderColorDisabled + placeholderColorDisabled, + fontSizeTiny, + fontSizeSmall, + fontSizeMedium, + fontSizeLarge, + heightTiny, + heightSmall, + heightMedium, + heightLarge } = vars return { ...commonVars, - borderRadius: borderRadius, + fontSizeTiny, + fontSizeSmall, + fontSizeMedium, + fontSizeLarge, + heightTiny, + heightSmall, + heightMedium, + heightLarge, + borderRadius, // default textColor: textColor2, textColorDisabled, diff --git a/src/_internal/selection/styles/light.ts b/src/_internal/selection/styles/light.ts index 0c383c694..150022ad9 100644 --- a/src/_internal/selection/styles/light.ts +++ b/src/_internal/selection/styles/light.ts @@ -25,11 +25,27 @@ const self = (vars: ThemeCommonVars) => { clearColorHover, clearColorPressed, placeholderColor, - placeholderColorDisabled + placeholderColorDisabled, + fontSizeTiny, + fontSizeSmall, + fontSizeMedium, + fontSizeLarge, + heightTiny, + heightSmall, + heightMedium, + heightLarge } = vars return { ...commonVariables, - borderRadius: borderRadius, + fontSizeTiny, + fontSizeSmall, + fontSizeMedium, + fontSizeLarge, + heightTiny, + heightSmall, + heightMedium, + heightLarge, + borderRadius, // default textColor: textColor2, textColorDisabled,