Skip to content

Commit

Permalink
refactor(scripts): support for multiple themes (#858)
Browse files Browse the repository at this point in the history
  • Loading branch information
typistZxd authored Apr 26, 2022
1 parent 50fb584 commit 6886ce3
Show file tree
Hide file tree
Showing 61 changed files with 358 additions and 311 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"build:site": "gulp build:site --max-old-space-size=8192 --gulpfile ./scripts/gulp/gulpfile.ts",
"icons": "gulp icons --gulpfile ./scripts/gulp/gulpfile.ts",
"gen": "ts-node scripts/gen/generate.ts",
"less-variable-update": "ts-node scripts/gen/style-variable/update.ts",
"lessvariable:update": "ts-node scripts/gen/style-variable/update.ts",
"prepare": "husky install",
"preinstall": "npx only-allow pnpm",
"version": "lerna version --conventional-commits",
Expand Down Expand Up @@ -98,6 +98,7 @@
"eslint-plugin-jsdoc": "^37.9.7",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^8.5.0",
"fast-glob": "^3.2.11",
"figlet": "^1.5.2",
"fs-extra": "^10.0.1",
"gulp": "^4.0.2",
Expand All @@ -110,9 +111,9 @@
"less-plugin-npm-import": "^2.1.0",
"lint-staged": "^12.3.7",
"lodash": "^4.17.21",
"npm-run-all": "^4.1.5",
"markdownlint-cli": "^0.30.0",
"marked": "^4.0.12",
"npm-run-all": "^4.1.5",
"ora": "^5.4.1",
"parse5": "^6.0.1",
"postcss-less": "^5.0.0",
Expand Down
10 changes: 5 additions & 5 deletions packages/components/alert/docs/Index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface AlertPagination {
<!--- insert less variable begin --->
## 主题变量

| 名称 | `default` | `dark` | 备注 |
| 名称 | default | seer | 备注 |
| --- | --- | --- | --- |
| `@alert-success-color` | `@color-success-d10` | - | - |
| `@alert-info-color` | `@color-info-d10` | - | - |
Expand All @@ -44,13 +44,13 @@ export interface AlertPagination {
| `@alert-warning-background-color` | `@color-warning-l50` | - | - |
| `@alert-error-background-color` | `@color-error-l50` | - | - |
| `@alert-color` | `@text-color` | - | - |
| `@alert-color-secondary` | `@text-color-secondary` | - | - |
| `@alert-color-secondary` | `@text-color-secondary` | `@color-graphite-l10` | - |
| `@alert-disabled-color` | `@disabled-color` | - | - |
| `@alert-font-size` | `@font-size-md` | - | - |
| `@alert-line-height` | `@line-height-base` | - | - |
| `@alert-font-size` | `@font-size-md` | `@font-size-sm` | - |
| `@alert-line-height` | `@line-height-base` | `@font-size-2xl` | - |
| `@alert-border-radius` | `@border-radius-sm` | - | - |
| `@alert-margin-bottom` | `@spacing-lg` | - | - |
| `@alert-padding` | `@spacing-sm @spacing-lg` | - | - |
| `@alert-padding` | `@spacing-sm @spacing-lg` | `@spacing-xs @spacing-lg` | - |
| `@alert-icon-margin-right` | `@spacing-sm` | - | - |
| `@alert-icon-font-size-with-description` | `@font-size-xl` | - | - |
| `@alert-icon-margin-right-with-description` | `@spacing-lg` | - | - |
Expand Down
12 changes: 6 additions & 6 deletions packages/components/anchor/docs/Index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@ subtitle: 锚点
<!--- insert less variable begin --->
## 主题变量

| 名称 | `default` | `dark` | 备注 |
| 名称 | default | seer | 备注 |
| --- | --- | --- | --- |
| `@anchor-background-color` | `@background-color-component` | - | - |
| `@anchor-wrapper-margin-left` | `-@spacing-xs` | - | - |
| `@anchor-wrapper-padding-left` | `@spacing-xs` | - | - |
| `@anchor-color` | `@text-color` | - | - |
| `@anchor-border-width` | `@border-width-md` | - | - |
| `@anchor-border-color` | `@border-color` | - | - |
| `@anchor-ink-ball-width` | `2px` | - | - |
| `@anchor-ink-ball-height` | `16px` | - | - |
| `@anchor-ink-ball-radius` | `2px` | - | - |
| `@anchor-ink-ball-width` | `2px` | `2px` | - |
| `@anchor-ink-ball-height` | `16px` | `16px` | - |
| `@anchor-ink-ball-radius` | `2px` | `2px` | - |
| `@anchor-ink-ball-background-color` | `@color-primary` | - | - |
| `@anchor-link-margin` | `@spacing-md 0 @spacing-md @spacing-lg` | - | - |
| `@anchor-link-font-size` | `@font-size-md` | - | - |
| `@anchor-link-margin` | `@spacing-md 0 @spacing-md @spacing-lg` | `@spacing-md 0 @spacing-lg @spacing-lg` | - |
| `@anchor-link-font-size` | `@font-size-md` | `@font-size-sm` | - |
| `@anchor-link-line-height` | `1` | - | - |
| `@anchor-ink-line-width` | `1px` | - | - |
| `@anchor-link-active-color` | `@color-primary` | - | - |
Expand Down
2 changes: 1 addition & 1 deletion packages/components/avatar/docs/Index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ order: 0
<!--- insert less variable begin --->
## 主题变量

| 名称 | `default` | `dark` | 备注 |
| 名称 | default | seer | 备注 |
| --- | --- | --- | --- |
| `@avatar-size-sm` | `@height-sm` | - | - |
| `@avatar-size-md` | `@height-md` | - | - |
Expand Down
6 changes: 3 additions & 3 deletions packages/components/back-top/docs/Index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ subtitle: 回到顶部
<!--- insert less variable begin --->
## 主题变量

| 名称 | `default` | `dark` | 备注 |
| 名称 | default | seer | 备注 |
| --- | --- | --- | --- |
| `@back-top-zindex` | `@zindex-l2-base` | - | - |
| `@back-top-height` | `60px` | - | - |
Expand All @@ -41,8 +41,8 @@ subtitle: 回到顶部
| `@back-top-right-lg` | `@back-top-right-gutter * 2` | - | - |
| `@back-top-right-xl` | `@back-top-right-gutter * 3` | - | - |
| `@back-top-bottom` | `50px` | - | - |
| `@back-top-color` | `@color-primary` | - | - |
| `@back-top-hover-color` | `@color-primary-l30` | - | - |
| `@back-top-color` | `@color-primary` | `@color-primary-l30` | - |
| `@back-top-hover-color` | `@color-primary-l30` | `@color-primary` | - |
| `@back-top-background-color` | `@color-white` | - | - |
| `@back-top-background-hover-color` | `@color-white` | - | - |
| `@back-top-box-shadow` | `0 2px 8px 0 rgba(30,35,43,0.12)` | - | - |
Expand Down
2 changes: 1 addition & 1 deletion packages/components/badge/docs/Index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ cover:
<!--- insert less variable begin --->
## 主题变量

| 名称 | `default` | `dark` | 备注 |
| 名称 | default | seer | 备注 |
| --- | --- | --- | --- |
| `@badge-zindex` | `@zindex-auto` | - | - |
| `@badge-font-size` | `@font-size-sm` | - | - |
Expand Down
6 changes: 3 additions & 3 deletions packages/components/breadcrumb/docs/Index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ order: 0
<!--- insert less variable begin --->
## 主题变量

| 名称 | `default` | `dark` | 备注 |
| 名称 | default | seer | 备注 |
| --- | --- | --- | --- |
| `@breadcrumb-base-color` | `@text-color-secondary` | - | - |
| `@breadcrumb-link-color` | `@color-graphite` | - | - |
| `@breadcrumb-link-color-hover` | `@color-primary` | - | - |
| `@breadcrumb-separator-color` | `@text-color-secondary` | - | - |
| `@breadcrumb-separator-color` | `@text-color-secondary` | `@color-graphite-l10` | - |
| `@breadcrumb-last-item-color` | `@color-graphite-d40` | - | - |
| `@breadcrumb-font-size` | `@font-size-base` | - | - |
| `@breadcrumb-separator-margin` | `0 @margin-sm` | - | - |
| `@breadcrumb-separator-margin` | `0 @margin-sm` | `0 @margin-xs` | - |
<!--- insert less variable end --->
7 changes: 3 additions & 4 deletions packages/components/button/docs/Index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ subtitle: 按钮
<!--- insert less variable begin --->
## 主题变量

| 名称 | `default` | `dark` | 备注 |
| 名称 | default | seer | 备注 |
| --- | --- | --- | --- |
| `@button-zindex` | `@zindex-l1-1` | - | - |
| `@button-font-weight` | `@font-weight-md` | - | - |
| `@button-line-height` | `@line-height-base` | - | - |
| `@button-height-xs` | `@height-sm` | - | - |
| `@button-height-sm` | `@height-md` | - | - |
| `@button-height-xs` | `@height-sm` | `24px` | - |
| `@button-height-sm` | `@height-md` | `32px` | - |
| `@button-height-md` | `@height-md` | - | - |
| `@button-height-lg` | `@height-lg` | - | - |
| `@button-height-xl` | `@height-xl` | - | - |
Expand Down Expand Up @@ -106,5 +106,4 @@ subtitle: 按钮
| `@button-text-hover-background-color` | `transparent` | - | - |
| `@button-icon-color` | `@color-graphite-d20` | - | - |
| `@button-icon-font-size` | `@font-size-lg` | - | - |
| `@button-icon-color` | `@color-graphite-d20` | - | - |
<!--- insert less variable end --->
4 changes: 2 additions & 2 deletions packages/components/card/docs/Index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ export interface CardButtonProps extends ButtonProps {
<!--- insert less variable begin --->
## 主题变量

| 名称 | `default` | `dark` | 备注 |
| 名称 | default | seer | 备注 |
| --- | --- | --- | --- |
| `@card-padding-sm` | `@spacing-md` | - | - |
| `@card-padding-sm` | `@spacing-md` | `@spacing-lg` | - |
| `@card-padding-md` | `@spacing-lg` | - | - |
| `@card-padding-lg` | `@spacing-xl` | - | - |
| `@card-color` | `@text-color` | - | - |
Expand Down
2 changes: 1 addition & 1 deletion packages/components/carousel/docs/Index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ order: 0
<!--- insert less variable begin --->
## 主题变量

| 名称 | `default` | `dark` | 备注 |
| 名称 | default | seer | 备注 |
| --- | --- | --- | --- |
| `@carousel-arrow-size` | `32px` | - | - |
| `@carousel-arrow-color` | `@color-white` | - | - |
Expand Down
12 changes: 6 additions & 6 deletions packages/components/checkbox/docs/Index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ cover:
<!--- insert less variable begin --->
## 主题变量

| 名称 | `default` | `dark` | 备注 |
| 名称 | default | seer | 备注 |
| --- | --- | --- | --- |
| `@checkbox-font-size-sm` | `@form-font-size-sm` | - | - |
| `@checkbox-font-size-md` | `@form-font-size-md` | - | - |
| `@checkbox-font-size-md` | `@form-font-size-md` | `@form-font-size-sm` | - |
| `@checkbox-font-size-lg` | `@form-font-size-lg` | - | - |
| `@checkbox-line-height` | `@form-line-height` | - | - |
| `@checkbox-height-sm` | `@form-height-sm` | - | - |
Expand All @@ -76,12 +76,12 @@ cover:
| `@checkbox-border-radius` | `@border-radius-sm` | - | - |
| `@checkbox-color` | `@form-color` | - | - |
| `@checkbox-background-color` | `@form-background-color` | - | - |
| `@checkbox-hover-color` | `@form-hover-color` | - | - |
| `@checkbox-hover-color` | `@form-hover-color` | `@form-active-color` | - |
| `@checkbox-active-color` | `@form-active-color` | - | - |
| `@checkbox-focus-color` | `@form-focus-color` | - | - |
| `@checkbox-focus-color` | `@form-focus-color` | `@form-active-color` | - |
| `@checkbox-disabled-color` | `@form-disabled-color` | - | - |
| `@checkbox-disabled-background-color` | `@form-disabled-background-color` | - | - |
| `@checkbox-font-size` | `@font-size-md` | - | - |
| `@checkbox-font-size` | `@font-size-md` | `@font-size-sm` | - |
| `@checkbox-inner-zindex` | `@zindex-l1-1` | - | - |
| `@checkbox-box-size` | `16px` | - | - |
| `@checkbox-box-border-radius` | `@border-radius-sm` | - | - |
Expand All @@ -91,6 +91,6 @@ cover:
| `@checkbox-tick-width` | `(@checkbox-box-size / @font-size-base) * 5px` | - | - |
| `@checkbox-tick-height` | `(@checkbox-box-size / @font-size-base) * 9px` | - | - |
| `@checkbox-tick-border-width` | `@border-width-md` | - | - |
| `@checkbox-label-padding` | `0 @spacing-sm` | - | - |
| `@checkbox-label-padding` | `0 @spacing-sm` | `0 @spacing-xs` | - |
| `@checkbox-group-item-margin-right` | `@spacing-sm` | - | - |
<!--- insert less variable end --->
2 changes: 1 addition & 1 deletion packages/components/collapse/docs/Index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ order: 0
<!--- insert less variable begin --->
## 主题变量

| 名称 | `default` | `dark` | 备注 |
| 名称 | default | seer | 备注 |
| --- | --- | --- | --- |
| `@collapse-line-height` | `@line-height-base` | - | - |
| `@collapse-font-size` | `@font-size-md` | - | - |
Expand Down
2 changes: 1 addition & 1 deletion packages/components/comment/docs/Index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ subtitle:
<!--- insert less variable begin --->
## 主题变量

| 名称 | `default` | `dark` | 备注 |
| 名称 | default | seer | 备注 |
| --- | --- | --- | --- |
| `@comment-padding-md` | `@spacing-md 0` | - | - |
| `@comment-margin-right` | `@spacing-md` | - | - |
Expand Down
2 changes: 1 addition & 1 deletion packages/components/date-picker/docs/Index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const defaultFormat = {
<!--- insert less variable begin --->
## 主题变量

| 名称 | `default` | `dark` | 备注 |
| 名称 | default | seer | 备注 |
| --- | --- | --- | --- |
| `@date-picker-line-height` | `@form-line-height` | - | - |
| `@date-picker-color` | `@form-color` | - | - |
Expand Down
2 changes: 1 addition & 1 deletion packages/components/divider/docs/Index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cover:
<!--- insert less variable begin --->
## 主题变量

| 名称 | `default` | `dark` | 备注 |
| 名称 | default | seer | 备注 |
| --- | --- | --- | --- |
| `@divider-border-width` | `@border-width-sm` | - | - |
| `@divider-border-color` | `@border-color` | - | - |
Expand Down
8 changes: 4 additions & 4 deletions packages/components/drawer/docs/Index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const openDrawer = () => open({
<!--- insert less variable begin --->
## 主题变量
| 名称 | `default` | `dark` | 备注 |
| 名称 | default | seer | 备注 |
| --- | --- | --- | --- |
| `@drawer-font-size` | `@font-size-md` | - | - |
| `@drawer-line-height` | `@line-height-base` | - | - |
Expand All @@ -188,8 +188,8 @@ const openDrawer = () => open({
| `@drawer-box-shadow-start` | `@shadow-right-lg` | - | - |
| `@drawer-box-shadow-end` | `@shadow-left-lg` | - | - |
| `@drawer-box-shadow-top` | `@shadow-bottom-lg` | - | - |
| `@drawer-header-padding` | `@spacing-lg @spacing-xl @spacing-sm` | - | - |
| `@drawer-body-padding` | `@spacing-sm @spacing-xl` | - | - |
| `@drawer-footer-padding` | `@spacing-sm @spacing-xl @spacing-lg` | - | - |
| `@drawer-header-padding` | `@spacing-lg @spacing-xl @spacing-sm` | `0 @spacing-lg 0` | - |
| `@drawer-body-padding` | `@spacing-sm @spacing-xl` | `@spacing-lg @spacing-2xl` | - |
| `@drawer-footer-padding` | `@spacing-sm @spacing-xl @spacing-lg` | `@spacing-md @spacing-lg @spacing-md` | - |
| `@drawer-footer-button-margin-left` | `@spacing-sm` | - | - |
<!--- insert less variable end --->
2 changes: 1 addition & 1 deletion packages/components/dropdown/docs/Index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ order: 0
<!--- insert less variable begin --->
## 主题变量

| 名称 | `default` | `dark` | 备注 |
| 名称 | default | seer | 备注 |
| --- | --- | --- | --- |
| `@dropdown-menu-item-height` | `@height-md` | - | - |
| `@dropdown-menu-item-margin` | `0` | - | - |
Expand Down
14 changes: 7 additions & 7 deletions packages/components/empty/docs/Index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ cols: 1
<!--- insert less variable begin --->
## 主题变量

| 名称 | `default` | `dark` | 备注 |
| 名称 | default | seer | 备注 |
| --- | --- | --- | --- |
| `@empty-line-height` | `@line-height-base` | - | - |
| `@empty-margin` | `@spacing-lg 0` | - | - |
| `@empty-image-margin-bottom` | `@spacing-sm` | - | - |
| `@empty-image-icon-opacity` | `0.3` | - | - |
| `@empty-image-icon-font-size` | `64px` | - | - |
| `@empty-image-icon-font-size` | `64px` | `48px` | - |
| `@empty-image-icon-color` | `@text-color` | - | - |
| `@empty-description-opacity` | `1` | - | - |
| `@empty-description-opacity` | `1` | `1` | - |
| `@empty-description-margin` | `0` | - | - |
| `@empty-description-color` | `@color-graphite-d10` | - | - |
| `@empty-description-font-size` | `@font-size-md` | - | - |
| `@empty-description-color` | `@color-graphite-d10` | `@color-graphite-d10` | - |
| `@empty-description-font-size` | `@font-size-md` | `@font-size-sm` | - |
| `@empty-content-margin-top` | `@spacing-lg` | - | - |
| `@empty-content-color` | `@color-graphite` | - | - |
| `@empty-content-font-size` | `@font-size-md` | - | - |
| `@empty-content-color` | `@color-graphite` | `@color-graphite` | - |
| `@empty-content-font-size` | `@font-size-md` | `@font-size-sm` | - |
<!--- insert less variable end --->
22 changes: 11 additions & 11 deletions packages/components/form/docs/Index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ export default defineComponent({
<!--- insert less variable begin --->
## 主题变量

| 名称 | `default` | `dark` | 备注 |
| 名称 | default | seer | 备注 |
| --- | --- | --- | --- |
| `@form-font-size-xs` | `@font-size-sm` | - | - |
| `@form-font-size-sm` | `@font-size-md` | - | - |
| `@form-font-size-md` | `@font-size-md` | - | - |
| `@form-font-size-lg` | `@font-size-lg` | - | - |
| `@form-font-size-sm` | `@font-size-md` | `@font-size-sm` | - |
| `@form-font-size-md` | `@font-size-md` | `@font-size-sm` | - |
| `@form-font-size-lg` | `@font-size-lg` | `@font-size-md` | - |
| `@form-line-height` | `@line-height-base` | - | - |
| `@form-height-xs` | `@height-xs` | - | - |
| `@form-height-sm` | `@height-sm` | - | - |
Expand All @@ -141,30 +141,30 @@ export default defineComponent({
| `@form-border-radius-lg` | `@border-radius-lg` | - | - |
| `@form-color` | `@text-color` | - | - |
| `@form-color-secondary` | `@text-color-secondary` | - | - |
| `@form-tooltip-color` | `@text-color-secondary` | - | - |
| `@form-tooltip-color` | `@text-color-secondary` | `@color-primary-l10` | - |
| `@form-background-color` | `@background-color-component` | - | - |
| `@form-placeholder-color` | `@color-graphite` | - | - |
| `@form-hover-color` | `@color-primary-l10` | - | - |
| `@form-active-color` | `@color-primary` | - | - |
| `@form-active-box-shadow` | `0 0 0 2px fade(@form-active-color, 20%)` | - | - |
| `@form-focus-color` | `@color-primary-d10` | - | - |
| `@form-focus-box-shadow` | `0 0 0 2px fade(@form-focus-color, 20%)` | - | - |
| `@form-disabled-color` | `@text-color-disabled` | - | - |
| `@form-disabled-color` | `@text-color-disabled` | `@color-graphite-l10` | - |
| `@form-disabled-border-color` | `@color-graphite-l20` | - | - |
| `@form-disabled-background-color` | `@background-color-disabled` | - | - |
| `@form-disabled-background-color` | `@background-color-disabled` | `@color-graphite-l40` | - |
| `@form-icon-color` | `@color-graphite-d20` | - | - |
| `@form-icon-hover-color` | `@color-graphite-d20` | - | - |
| `@form-icon-hover-color` | `@color-graphite-d20` | `@color-primary` | - |
| `@form-item-valid-color` | `@color-success` | - | - |
| `@form-item-validating-color` | `@color-pending` | - | - |
| `@form-item-invalid-color` | `@color-error` | - | - |
| `@form-item-invalid-box-shadow` | `0 0 0 2px fade(@form-item-invalid-color, 20%)` | - | - |
| `@form-item-margin-bottom` | `24px` | - | - |
| `@form-item-margin-bottom` | `24px` | `@spacing-sm` | - |
| `@form-item-vertical-label-margin` | `0` | - | - |
| `@form-item-vertical-label-padding` | `0 0 8px` | - | - |
| `@form-item-font-size` | `@font-size-md` | - | - |
| `@form-item-font-size` | `@font-size-md` | `@font-size-sm` | - |
| `@form-item-font-height` | `ceil(@form-item-font-size * @form-line-height)` | - | - |
| `@form-item-label-required-color` | `@color-red-l10` | - | - |
| `@form-item-label-color` | `@color-black` | - | - |
| `@form-item-label-color` | `@color-black` | `@color-graphite-d10` | - |
| `@form-item-label-colon-margin-right` | `8px` | - | - |
| `@form-item-label-colon-margin-left` | `2px` | - | - |
| `@form-item-label-margin-left` | `8px` | - | - |
Expand Down
2 changes: 1 addition & 1 deletion packages/components/grid/docs/Index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ order: 0
<!--- insert less variable begin --->
## 主题变量

| 名称 | `default` | `dark` | 备注 |
| 名称 | default | seer | 备注 |
| --- | --- | --- | --- |
| `@grid-columns` | `24` | - | - |
<!--- insert less variable end --->
Loading

0 comments on commit 6886ce3

Please sign in to comment.