From affdcd2c9d7768f835578816d42cf62127cca830 Mon Sep 17 00:00:00 2001 From: wuduoyi Date: Wed, 29 Jun 2022 20:58:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20input-password=20?= =?UTF-8?q?=E5=9C=A8=20antd=20=E4=B8=8B=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/amis-ui/scss/_properties.scss | 5 +++ .../amis-ui/scss/themes/_cxd-variables.scss | 2 -- scripts/var-not-in-common.js | 34 +++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 scripts/var-not-in-common.js diff --git a/packages/amis-ui/scss/_properties.scss b/packages/amis-ui/scss/_properties.scss index 312c59377..6fb5ab7fa 100644 --- a/packages/amis-ui/scss/_properties.scss +++ b/packages/amis-ui/scss/_properties.scss @@ -1,4 +1,5 @@ // 这里放 css 自定义变量 +@import './cxd-colors'; :root { --black: #{$black}; @@ -736,6 +737,10 @@ --Form-input-onHover-bg: #{rgba($white, 0.6)}; --Form-input-onHover-borderColor: var(--Form-input-onFocused-borderColor); --Form-input-paddingX: #{px2rem(8px)}; + + --Form-input-password-icon-size: #{px2rem(16px)}; + --Form-input-password-icon-color: #{$G5}; + --Form-inputNumber-paddingX: #{px2rem(12px)}; --Form-inputNumber-base-width: #{px2rem(24px)}; --Form-inputNumber-base-height: #{px2rem(32px)}; diff --git a/packages/amis-ui/scss/themes/_cxd-variables.scss b/packages/amis-ui/scss/themes/_cxd-variables.scss index 782a7e5e0..9c7173a6f 100644 --- a/packages/amis-ui/scss/themes/_cxd-variables.scss +++ b/packages/amis-ui/scss/themes/_cxd-variables.scss @@ -159,8 +159,6 @@ $L1: 0px 4px 6px 0px rgba(8, 14, 26, 0.06), --Form-input-clearBtn-color: #{$G7}; --Form-input-clearBtn-color-onHover: #{$G4}; --Form-input-clearBtn-color-onActive: #{$G3}; - --Form-input-password-icon-size: #{px2rem(16px)}; - --Form-input-password-icon-color: #{$G5}; --Form-select-borderWidth: #{px2rem(1px)}; --Form-select-borderRadius: #{$R3}; diff --git a/scripts/var-not-in-common.js b/scripts/var-not-in-common.js new file mode 100644 index 000000000..84d947bb9 --- /dev/null +++ b/scripts/var-not-in-common.js @@ -0,0 +1,34 @@ +/** + * 用于查找某个变量在 cxd-variables 里但不在 properties.scss 里的情况 + */ + +const fs = require('fs'); +const path = require('path'); + +const cxdVariables = fs.readFileSync( + path.join(__dirname, '..', 'scss', 'themes', '_cxd-variables.scss'), + {encoding: 'utf8'} +); + +const commonVariables = fs.readFileSync( + path.join(__dirname, '..', 'scss', '_properties.scss'), + {encoding: 'utf8'} +); + +const cxdVariableSet = new Set(); + +cxdVariables.match(/\-\-[\-a-zA-Z0-9]+/g).forEach(function (variable) { + cxdVariableSet.add(variable); +}); + +const commonVariableSet = new Set(); + +commonVariables.match(/\-\-[\-a-zA-Z0-9]+/g).forEach(function (variable) { + commonVariableSet.add(variable); +}); + +for (const variable of cxdVariableSet) { + if (!commonVariableSet.has(variable)) { + console.log(variable); + } +}