Skip to content

Commit

Permalink
refactor(theme): [divider] refactor divider theme vars
Browse files Browse the repository at this point in the history
  • Loading branch information
zzcr committed Oct 11, 2024
1 parent feea189 commit a8cc5ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
12 changes: 5 additions & 7 deletions packages/theme/src/divider/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
@divider-prefix-cls: ~'@{css-prefix}divider';

.@{divider-prefix-cls} {
.component-css-vars-divider();
.inject-Divider-vars();
position: relative;

&&--horizontal {
display: block;
margin: 24px 0;
border-top: 1px solid var(--ti-divider-dividing-line);
opacity: var(--ti-divider-horizontal-opacity);
border-top: 1px solid var(--tv-Divider-dividing-line);
}

&&--vertical {
Expand All @@ -20,16 +19,15 @@
height: 1em;
margin: 0 8px;
vertical-align: middle;
border-left: 1px solid var(--ti-divider-dividing-line);
opacity: var(--ti-divider-vertical-opacity);
border-left: 1px solid var(--tv-Divider-dividing-line);
}

&__text {
position: absolute;
font-size: 14px;
font-weight: 500;
color: var(--ti-divider-text-color);
background-color: var(--ti-divider-text-bg-color);
color: var(--tv-Divider-text-color);
background-color: var(--tv-Divider-text-bg-color);

&.is-left {
left: 20px;
Expand Down
14 changes: 5 additions & 9 deletions packages/theme/src/divider/vars.less
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
.component-css-vars-divider() {
// 不开放(hide)
--ti-divider-dividing-line: var(--ti-common-color-bg-dark-disabled, #dbdbdb);
.inject-Divider-vars() {
// 分割线颜色
--tv-Divider-dividing-line: var(--tv-color-border-divider-short);
// 文案背景色
--ti-divider-text-bg-color: var(--ti-common-color-line-dividing, #f0f0f0);
--tv-Divider-text-bg-color: var(--tv-color-border-divider);
// 文案文本色
--ti-divider-text-color: var(--ti-common-color-text-primary, #191919);
//分割线横向透明度
--ti-divider-horizontal-opacity: 1;
//分割线纵向透明度
--ti-divider-vertical-opacity: 1;
--tv-Divider-text-color: var(--tv-color-text);
}

0 comments on commit a8cc5ac

Please sign in to comment.