diff --git a/packages/amis-ui/scss/_properties.scss b/packages/amis-ui/scss/_properties.scss index 312c59377b8..9bf9c2dbec7 100644 --- a/packages/amis-ui/scss/_properties.scss +++ b/packages/amis-ui/scss/_properties.scss @@ -1,4 +1,5 @@ // 这里放 css 自定义变量 +@import './themes/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 782a7e5e06c..9c7173a6fee 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 00000000000..84d947bb97f --- /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); + } +}