Skip to content

Commit 3c27230

Browse files
committed
docs: update css vars
1 parent c96f143 commit 3c27230

5 files changed

Lines changed: 19 additions & 11 deletions

File tree

script/generate-css-vars.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ const combine = {
2121
grid: ['grid', 'grid-item'],
2222
layout: ['row', 'col'],
2323
form: ['form', 'form-item'],
24+
qrcode: ['qrcode', 'qrcode/components/qrcode-canvas', 'qrcode/components/qrcode-status'],
2425
};
2526

2627
const resolveCwd = (...args) => {
2728
args.unshift(process.cwd());
2829
return path.join(...args);
2930
};
3031

31-
const findFilePath = (componentName) => resolveCwd(`src/${componentName}/${componentName}.less`);
32+
const findFilePath = (componentPath, componentName) => resolveCwd(`src/${componentPath}/${componentName}.less`);
3233

3334
const getAllComponentName = async (dirPath) => {
3435
const items = await fs.promises.readdir(dirPath, { withFileTypes: true });
@@ -42,10 +43,10 @@ const generateCssVariables = async (componentName) => {
4243

4344
if (combine[componentName]) {
4445
combine[componentName].forEach((item) => {
45-
lessPath.push(findFilePath(item));
46+
lessPath.push(findFilePath(item, item.includes('/') ? item.split('/').pop() : item));
4647
});
4748
} else {
48-
lessPath.push(findFilePath(componentName));
49+
lessPath.push(findFilePath(componentName, componentName));
4950
}
5051

5152
const validPaths = lessPath.filter((item) => fs.existsSync(item));

src/navbar/README.en-US.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Name | Default Value | Description
5353
--td-navbar-capsule-height | 32px | -
5454
--td-navbar-capsule-width | 88px | -
5555
--td-navbar-center-left | @navbar-right | -
56-
--td-navbar-center-width | --td-navbar-center-width | -
56+
--td-navbar-center-width | 187px | -
5757
--td-navbar-color | @text-color-primary | -
5858
--td-navbar-height | 48px | -
5959
--td-navbar-left-arrow-size | 24px | -

src/navbar/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ t-class-title | 标题样式类
102102
--td-navbar-capsule-height | 32px | -
103103
--td-navbar-capsule-width | 88px | -
104104
--td-navbar-center-left | @navbar-right | -
105-
--td-navbar-center-width | --td-navbar-center-width | -
105+
--td-navbar-center-width | 187px | -
106106
--td-navbar-color | @text-color-primary | -
107107
--td-navbar-height | 48px | -
108108
--td-navbar-left-arrow-size | 24px | -

src/qrcode/README.en-US.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,12 @@ value | String | - | scanned text | N
2424
name | params | description
2525
-- | -- | --
2626
refresh | \- | Click the "Click to refresh" callback
27+
28+
### CSS Variables
29+
30+
The component provides the following CSS variables, which can be used to customize styles.
31+
Name | Default Value | Description
32+
-- | -- | --
33+
--td-font-size-title-small | --td-font-size-title-small | -
34+
--td-brand-color-hover | --td-brand-color-hover | -
35+
--td-success-color | --td-success-color | -

src/qrcode/README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,9 @@ t-class | 根节点样式类
101101

102102
### CSS Variables
103103

104-
105104
组件提供了下列 CSS 变量,可用于自定义样式。
106-
107-
名称 | 默认值 | 描述
105+
名称 | 默认值 | 描述
108106
-- | -- | --
109-
--td-qrcode-border-color | #dcdcdc | -
110-
--td-qrcode-border-width | 1px | -
111-
--td-qrcode-border-radius | 6px | -
107+
--td-font-size-title-small | --td-font-size-title-small | -
108+
--td-brand-color-hover | --td-brand-color-hover | -
109+
--td-success-color | --td-success-color | -

0 commit comments

Comments
 (0)