Skip to content

Commit

Permalink
refactor(tabs): [tabs] 重构tabs主题
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxi-20 committed Oct 15, 2024
1 parent 50c0b05 commit 0fa4b5f
Show file tree
Hide file tree
Showing 8 changed files with 523 additions and 594 deletions.
28 changes: 14 additions & 14 deletions examples/sites/demos/pc/webdoc/theme-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ If the original format is `--ti-pager-primary-color:red;`, manually replace it w

`Special circumstances`:

Example 3: Query the special variable table. It is similar to a variable that contains the `border` field. If the new variable to be split contains `border-weight (border thickness), border-style (border style), and border-color (border color)`, For example, `--ti-tabs-item-active-border`is split into`--ti-tabs-item-active-border-weight,--ti-tabs-item-active-border-style, --ti-tabs-item-active-border-color`;
Example 3: Query the special variable table. It is similar to a variable that contains the `border` field. If the new variable to be split contains `border-weight (border thickness), border-style (border style), and border-color (border color)`, For example, `--tv-Tabs-item-active-border`is split into`--tv-Tabs-item-active-border-weight,--tv-Tabs-item-active-border-style, --tv-Tabs-item-active-border-color`;

If the original style is `--ti-tabs-item-active-border: 1px solid red;`, manually replace it with `--ti-tabs-item-active-border-weight: 1px; --ti-tabs-item-active-border-style: solid; --ti-tabs-item-active-border-color: red;`.
If the original style is `--tv-Tabs-item-active-border: 1px solid red;`, manually replace it with `--tv-Tabs-item-active-border-weight: 1px; --tv-Tabs-item-active-border-style: solid; --tv-Tabs-item-active-border-color: red;`.

Example 4: If the variable split from `--ti-radio-button-checked-hover-color` contains the `box-shadow` field, you need to write the `box-shadow` style separately.

Expand Down Expand Up @@ -307,20 +307,20 @@ The mapping table of special variables is attached. There are 48 special variabl
"--ti-switch-checked-disabled-border-color"
],
"--ti-switch-dot-size": ["--ti-switch-dot-size-height-width", "--ti-switch-dot-position-left"],
"--ti-tabs-item-active-border": [
"--ti-tabs-item-active-border-weight",
"--ti-tabs-item-active-border-style",
"--ti-tabs-item-active-border-color"
"--tv-Tabs-item-active-border": [
"--tv-Tabs-item-active-border-weight",
"--tv-Tabs-item-active-border-style",
"--tv-Tabs-item-active-border-color"
],
"--ti-tabs-item-border-bottom": [
"--ti-tabs-item-bottom-border-weight",
"--ti-tabs-item-bottom-border-style",
"--ti-tabs-item-bottom-border-color"
"--tv-Tabs-item-border-bottom": [
"--tv-Tabs-item-bottom-border-weight",
"--tv-Tabs-item-bottom-border-style",
"--tv-Tabs-item-bottom-border-color"
],
"--ti-tabs-icon-close-margin": [
"--ti-tabs-icon-close-margin-vertical",
"--ti-tabs-icon-close-margin-right",
"--ti-tabs-icon-close-margin-left"
"--tv-Tabs-icon-close-margin": [
"--tv-Tabs-icon-close-margin-vertical",
"--tv-Tabs-icon-close-margin-right",
"--tv-Tabs-icon-close-margin-left"
],
"--ti-tooltip-padding": ["--ti-tooltip-padding-vertical", "--ti-tooltip-padding-horizontal"],
"--ti-upload-list-picture-card-item-bgcolor": [
Expand Down
8 changes: 4 additions & 4 deletions examples/sites/src/views/components/components.vue
Original file line number Diff line number Diff line change
Expand Up @@ -772,10 +772,10 @@ export default defineComponent({
}
.docs-content-tabs {
--ti-tabs-heigh: 48px;
--ti-tabs-item-font-size: 18px;
--ti-tabs-header-font-active-text-color: #2f5bea;
--ti-tabs-item-active-border-color: #2f5bea;
--tv-Tabs-heigh: 48px;
--tv-Tabs-item-font-size: 18px;
--tv-Tabs-header-font-active-text-color: #2f5bea;
--tv-Tabs-item-active-border-color: #2f5bea;
flex: 1;
transition: all ease-in-out 0.3s;
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/src/bulletin-board/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
bottom: 0;
width: 100%;
height: 1px;
background-color: var(--ti-tabs-border-color);
background-color: var(--tv-Tabs-border-color);
z-index: 1;
}

Expand Down
29 changes: 14 additions & 15 deletions packages/theme/src/tabs/aurora-theme.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
export const tinyTabsAuroraTheme = {
'ti-tabs-header-font-weight-active': 'var(--ti-common-font-weight-7)',
'ti-tabs-dark-margin-top': 'var(--ti-common-space-0)',
'ti-tabs-dark-bg-color-active': 'var(--ti-common-bg-minor-active)',
'ti-tabs-header-dark-bg-color': 'var(--ti-common-color-selected-background)',
'ti-tabs-dark-first-margin-left': 'var(--ti-common-space-0)',
'ti-tabs-content-font-size': 'var(--ti-common-font-size-base)',
'ti-tabs-item-card-border-color': 'var(--ti-common-color-line-normal)',
'ti-tabs-item-top-right-border-weight': 'var(--ti-common-size-0)',
'ti-tabs-dark-bg-color-hover': 'none',
'ti-tabs-dark-text-color-hover': 'var(--ti-common-color-primary-normal)',
'ti-tabs-dark-text-color-active': 'var(--ti-common-color-primary-normal)',
'ti-tabs-dark-border-weight': 'var(--ti-common-border-weight-normal)',
'ti-tabs-item-padding-horizontal': 'var(--ti-common-space-6x)',
'ti-tabs-item-margin-right': 'var(--ti-common-space-6x)',
'ti-tabs-header-separator-height': 'var(--ti-common-space-3x)'
'tv-Tabs-header-font-weight-active': 'var(--ti-common-font-weight-7)',
'tv-Tabs-dark-margin-top': 'var(--ti-common-space-0)',
'tv-Tabs-dark-bg-color-active': 'var(--ti-common-bg-minor-active)',
'tv-Tabs-header-dark-bg-color': 'var(--ti-common-color-selected-background)',
'tv-Tabs-dark-first-margin-left': 'var(--ti-common-space-0)',
'tv-Tabs-item-card-border-color': 'var(--ti-common-color-line-normal)',
'tv-Tabs-item-top-right-border-weight': 'var(--ti-common-size-0)',
'tv-Tabs-dark-bg-color-hover': 'none',
'tv-Tabs-dark-text-color-hover': 'var(--ti-common-color-primary-normal)',
'tv-Tabs-dark-text-color-active': 'var(--ti-common-color-primary-normal)',
'tv-Tabs-dark-border-weight': 'var(--ti-common-border-weight-normal)',
'tv-Tabs-item-padding-horizontal': 'var(--ti-common-space-6x)',
'tv-Tabs-item-margin-right': 'var(--ti-common-space-6x)',
'tv-Tabs-header-separator-height': 'var(--ti-common-space-3x)'
}
Loading

0 comments on commit 0fa4b5f

Please sign in to comment.