diff --git a/scripts/test/generate-css-vars.js b/scripts/test/generate-css-vars.js index 983267ca9..92aecc7e9 100644 --- a/scripts/test/generate-css-vars.js +++ b/scripts/test/generate-css-vars.js @@ -2,11 +2,16 @@ const fs = require('fs'); const path = require('path'); const combine = { - cell: ['cell', 'cell-group'], - dropdown: ['dropdown-menu', 'dropdown-item'], + avatar: ['avatar-group', 'avatar'], + cell: ['cell-group', 'cell'], + collapse: ['collapse', 'collapse-panel'], + 'dropdown-menu': ['dropdown-menu', 'dropdown-item'], tag: ['tag', 'check-tag'], - checkbox: ['checkbox', 'checkbox-group'], + checkbox: ['checkbox-group', 'checkbox'], indexes: ['indexes', 'indexes-anchor'], + picker: ['picker', 'picker-item'], + radio: ['radio-group', 'radio'], + 'side-bar': ['side-bar', 'side-bar-item'], steps: ['steps', 'step-item'], swiper: ['swiper', 'swiper-nav'], tabs: ['tabs', 'tab-panel'], @@ -35,7 +40,7 @@ function findFilePath(componentName) { // 使用 v2 文件夹下 _var.less 文件 const lessPath = []; if (combine[COMPONENT_NAME]) { - combine[COMPONENT_NAME].map((item, index) => { + combine[COMPONENT_NAME].forEach((item) => { lessPath.push(findFilePath(item)); }); } else { @@ -50,7 +55,7 @@ fs.appendFileSync(resolveCwd(`src/${COMPONENT_NAME}/${COMPONENT_NAME}.md`), cssV fs.appendFileSync(resolveCwd(`src/${COMPONENT_NAME}/${COMPONENT_NAME}.en-US.md`), cssVariableHeadContentEn); // 读取 less 文件内容 -lessPath.map((item, index) => { +lessPath.forEach((item) => { if (fs.existsSync(item)) { fs.readFile(item, 'utf8', (err, file) => { if (err) { @@ -59,7 +64,7 @@ lessPath.map((item, index) => { } const list = file.match(matchReg)?.sort(); let cssVariableBodyContent = ''; - list?.map((item, index) => { + list?.forEach((item) => { cssVariableBodyContent += `${item.slice(1, item.indexOf(','))} | ${item.slice( item.indexOf(',') + 2, item.length - 1, diff --git a/src/avatar/avatar.en-US.md b/src/avatar/avatar.en-US.md index 75e12fdc2..1235d74b3 100644 --- a/src/avatar/avatar.en-US.md +++ b/src/avatar/avatar.en-US.md @@ -35,6 +35,9 @@ size | String | medium | size | N The component provides the following CSS variables, which can be used to customize styles. Name | Default Value | Description -- | -- | -- +--td-avatar-group-margin-left-large | -8px | - +--td-avatar-group-margin-left-medium | -6px | - +--td-avatar-group-margin-left-small | -4px | - --td-avatar-bg-color | @brand-color-light-active | - --td-avatar-border-color | #fff | - --td-avatar-border-width-large | 4px | - @@ -42,9 +45,6 @@ Name | Default Value | Description --td-avatar-border-width-small | 2px | - --td-avatar-circle-border-radius | @radius-circle | - --td-avatar-content-color | @brand-color | - ---td-avatar-group-margin-left-large | -8px | - ---td-avatar-group-margin-left-medium | -6px | - ---td-avatar-group-margin-left-small | -4px | - --td-avatar-icon-large-font-size | 32px | - --td-avatar-icon-medium-font-size | 24px | - --td-avatar-icon-small-font-size | 20px | - diff --git a/src/avatar/avatar.md b/src/avatar/avatar.md index 8395162e8..d41830551 100644 --- a/src/avatar/avatar.md +++ b/src/avatar/avatar.md @@ -35,6 +35,9 @@ size | String | medium | 尺寸,示例值:small/medium/large/24px/38px 等 组件提供了下列 CSS 变量,可用于自定义样式。 名称 | 默认值 | 描述 -- | -- | -- +--td-avatar-group-margin-left-large | -8px | - +--td-avatar-group-margin-left-medium | -6px | - +--td-avatar-group-margin-left-small | -4px | - --td-avatar-bg-color | @brand-color-light-active | - --td-avatar-border-color | #fff | - --td-avatar-border-width-large | 4px | - @@ -42,9 +45,6 @@ size | String | medium | 尺寸,示例值:small/medium/large/24px/38px 等 --td-avatar-border-width-small | 2px | - --td-avatar-circle-border-radius | @radius-circle | - --td-avatar-content-color | @brand-color | - ---td-avatar-group-margin-left-large | -8px | - ---td-avatar-group-margin-left-medium | -6px | - ---td-avatar-group-margin-left-small | -4px | - --td-avatar-icon-large-font-size | 32px | - --td-avatar-icon-medium-font-size | 24px | - --td-avatar-icon-small-font-size | 20px | - diff --git a/src/dropdown-menu/dropdown-menu.en-US.md b/src/dropdown-menu/dropdown-menu.en-US.md index 16a035928..b720a88d7 100644 --- a/src/dropdown-menu/dropdown-menu.en-US.md +++ b/src/dropdown-menu/dropdown-menu.en-US.md @@ -40,6 +40,8 @@ reset | `(value: DropdownValue)` | \- The component provides the following CSS variables, which can be used to customize styles. Name | Default Value | Description -- | -- | -- +--td-dropdown-body-max-height | 280px | - +--td-dropdown-menu-bg-color | @bg-color-container | - --td-dropdown-menu-active-colorm | @brand-color | - --td-dropdown-menu-bg-colorm | @bg-color-container | - --td-dropdown-menu-colorm | @font-gray-1 | - diff --git a/src/dropdown-menu/dropdown-menu.md b/src/dropdown-menu/dropdown-menu.md index 3388c1945..934d05078 100644 --- a/src/dropdown-menu/dropdown-menu.md +++ b/src/dropdown-menu/dropdown-menu.md @@ -40,6 +40,8 @@ reset | `(value: DropdownValue)` | 点击重置时触发 组件提供了下列 CSS 变量,可用于自定义样式。 名称 | 默认值 | 描述 -- | -- | -- +--td-dropdown-body-max-height | 280px | - +--td-dropdown-menu-bg-color | @bg-color-container | - --td-dropdown-menu-active-colorm | @brand-color | - --td-dropdown-menu-bg-colorm | @bg-color-container | - --td-dropdown-menu-colorm | @font-gray-1 | -