mirror of
https://github.com/element-plus/element-plus.git
synced 2024-12-21 02:50:11 +08:00
refactor: migrate tree/popup/form/timeline-item css var (#2697)
This commit is contained in:
parent
62976c27e3
commit
3f4e0f6f33
@ -1,6 +1,11 @@
|
|||||||
@import './var.scss';
|
@import './var.scss';
|
||||||
@import '../mixins/mixins';
|
@import '../mixins/mixins';
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--el-popup-modal-background-color: var(--el-color-black);
|
||||||
|
--el-popup-modal-opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
.v-modal-enter {
|
.v-modal-enter {
|
||||||
animation: v-modal-in var(--el-transition-duration-fast) ease;
|
animation: v-modal-in var(--el-transition-duration-fast) ease;
|
||||||
}
|
}
|
||||||
@ -31,8 +36,8 @@
|
|||||||
top: 0;
|
top: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
opacity: $--popup-modal-opacity;
|
opacity: var(--el-popup-modal-opacity);
|
||||||
background: $--popup-modal-background-color;
|
background: var(--el-popup-modal-background-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
@include b(popup-parent) {
|
@include b(popup-parent) {
|
||||||
|
@ -453,10 +453,8 @@ $--button-active-shade-percent: 10% !default;
|
|||||||
|
|
||||||
/* Popup
|
/* Popup
|
||||||
-------------------------- */
|
-------------------------- */
|
||||||
/// color||Color|0
|
// refactor with css3 var
|
||||||
$--popup-modal-background-color: $--color-black !default;
|
// See packages/theme-chalk/src/popup.scss
|
||||||
/// opacity||Other|1
|
|
||||||
$--popup-modal-opacity: 0.5 !default;
|
|
||||||
|
|
||||||
/* Popover
|
/* Popover
|
||||||
-------------------------- */
|
-------------------------- */
|
||||||
@ -475,12 +473,8 @@ $--popup-modal-opacity: 0.5 !default;
|
|||||||
|
|
||||||
/* Tree
|
/* Tree
|
||||||
-------------------------- */
|
-------------------------- */
|
||||||
/// color||Color|0
|
// refactor with css3 var
|
||||||
$--tree-node-hover-background-color: $--background-color-base !default;
|
// See packages/theme-chalk/src/tree.scss
|
||||||
/// color||Color|0
|
|
||||||
$--tree-font-color: var(--el-text-color-regular) !default;
|
|
||||||
/// color||Color|0
|
|
||||||
$--tree-expand-icon-color: var(--el-text-color-placeholder) !default;
|
|
||||||
|
|
||||||
/* Dropdown
|
/* Dropdown
|
||||||
-------------------------- */
|
-------------------------- */
|
||||||
@ -600,9 +594,8 @@ $--loading-fullscreen-spinner-size: 50px !default;
|
|||||||
|
|
||||||
/* Timeline
|
/* Timeline
|
||||||
--------------------------*/
|
--------------------------*/
|
||||||
$--timeline-node-size-normal: 12px !default;
|
// refactor with css3 var
|
||||||
$--timeline-node-size-large: 14px !default;
|
// See packages/theme-chalk/src/timeline-item.scss
|
||||||
$--timeline-node-color: map.get($--border-color, 'light') !default;
|
|
||||||
|
|
||||||
/* Backtop
|
/* Backtop
|
||||||
--------------------------*/
|
--------------------------*/
|
||||||
@ -628,8 +621,8 @@ $--backtop-hover-background-color: map.get(
|
|||||||
|
|
||||||
/* Form
|
/* Form
|
||||||
-------------------------- */
|
-------------------------- */
|
||||||
/// fontSize||Font|1
|
// refactor with css3 var
|
||||||
$--form-label-font-size: map.get($--font-size, 'base') !default;
|
// See packages/theme-chalk/src/form.scss
|
||||||
|
|
||||||
/* Avatar
|
/* Avatar
|
||||||
--------------------------*/
|
--------------------------*/
|
||||||
|
@ -2,6 +2,10 @@
|
|||||||
@import 'mixins/utils';
|
@import 'mixins/utils';
|
||||||
@import 'common/var';
|
@import 'common/var';
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--el-form-label-font-size: var(--el-font-size-base);
|
||||||
|
}
|
||||||
|
|
||||||
@include b(form) {
|
@include b(form) {
|
||||||
@include m(label-left) {
|
@include m(label-left) {
|
||||||
& .#{$namespace}-form-item__label {
|
& .#{$namespace}-form-item__label {
|
||||||
@ -93,7 +97,7 @@
|
|||||||
@include e(label) {
|
@include e(label) {
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
font-size: $--form-label-font-size;
|
font-size: var(--el-form-label-font-size);
|
||||||
color: var(--el-text-color-regular);
|
color: var(--el-text-color-regular);
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
padding: 0 12px 0 0;
|
padding: 0 12px 0 0;
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
@import 'mixins/mixins';
|
@import 'mixins/mixins';
|
||||||
@import 'common/var';
|
@import 'common/var';
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--el-timeline-node-size-normal: 12px;
|
||||||
|
--el-timeline-node-size-large: 14px;
|
||||||
|
--el-timeline-node-color: var(--el-border-color-light);
|
||||||
|
}
|
||||||
|
|
||||||
@include b(timeline-item) {
|
@include b(timeline-item) {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
@ -15,17 +21,17 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
left: 4px;
|
left: 4px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-left: 2px solid $--timeline-node-color;
|
border-left: 2px solid var(--el-timeline-node-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
@include e(icon) {
|
@include e(icon) {
|
||||||
color: $--color-white;
|
color: var(--el-color-white);
|
||||||
font-size: var(--el-font-size-small);
|
font-size: var(--el-font-size-small);
|
||||||
}
|
}
|
||||||
|
|
||||||
@include e(node) {
|
@include e(node) {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background-color: $--timeline-node-color;
|
background-color: var(--el-timeline-node-color);
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@ -33,29 +39,17 @@
|
|||||||
|
|
||||||
@include m(normal) {
|
@include m(normal) {
|
||||||
left: -1px;
|
left: -1px;
|
||||||
width: $--timeline-node-size-normal;
|
width: var(--el-timeline-node-size-normal);
|
||||||
height: $--timeline-node-size-normal;
|
height: var(--el-timeline-node-size-normal);
|
||||||
}
|
}
|
||||||
@include m(large) {
|
@include m(large) {
|
||||||
left: -2px;
|
left: -2px;
|
||||||
width: $--timeline-node-size-large;
|
width: var(--el-timeline-node-size-large);
|
||||||
height: $--timeline-node-size-large;
|
height: var(--el-timeline-node-size-large);
|
||||||
}
|
}
|
||||||
|
|
||||||
@include m(primary) {
|
@each $type in (primary, success, warning, danger, info) {
|
||||||
background-color: var(--el-color-primary);
|
background-color: var(--el-color-#{$type});
|
||||||
}
|
|
||||||
@include m(success) {
|
|
||||||
background-color: var(--el-color-success);
|
|
||||||
}
|
|
||||||
@include m(warning) {
|
|
||||||
background-color: var(--el-color-warning);
|
|
||||||
}
|
|
||||||
@include m(danger) {
|
|
||||||
background-color: var(--el-color-danger);
|
|
||||||
}
|
|
||||||
@include m(info) {
|
|
||||||
background-color: var(--el-color-info);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,11 +3,17 @@
|
|||||||
@import 'common/transition';
|
@import 'common/transition';
|
||||||
@import 'checkbox';
|
@import 'checkbox';
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--el-tree-node-hover-background-color: var(--el-background-color-base);
|
||||||
|
--el-tree-font-color: var(--el-text-color-regular);
|
||||||
|
--el-tree-expand-icon-color: var(--el-text-color-placeholder);
|
||||||
|
}
|
||||||
|
|
||||||
@include b(tree) {
|
@include b(tree) {
|
||||||
position: relative;
|
position: relative;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
background: $--color-white;
|
background: var(--el-color-white);
|
||||||
color: $--tree-font-color;
|
color: var(--el-tree-font-color);
|
||||||
|
|
||||||
@include e(empty-block) {
|
@include e(empty-block) {
|
||||||
position: relative;
|
position: relative;
|
||||||
@ -41,7 +47,7 @@
|
|||||||
&:focus {
|
&:focus {
|
||||||
/* focus */
|
/* focus */
|
||||||
> .#{$namespace}-tree-node__content {
|
> .#{$namespace}-tree-node__content {
|
||||||
background-color: $--tree-node-hover-background-color;
|
background-color: var(--el-tree-node-hover-background-color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,7 +71,7 @@
|
|||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
}
|
}
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: $--tree-node-hover-background-color;
|
background-color: var(--el-tree-node-hover-background-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.#{$namespace}-tree.is-dragging & {
|
.#{$namespace}-tree.is-dragging & {
|
||||||
@ -83,7 +89,7 @@
|
|||||||
|
|
||||||
@include e(expand-icon) {
|
@include e(expand-icon) {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: $--tree-expand-icon-color;
|
color: var(--el-tree-expand-icon-color);
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
|
||||||
transform: rotate(0deg);
|
transform: rotate(0deg);
|
||||||
@ -106,7 +112,7 @@
|
|||||||
@include e(loading-icon) {
|
@include e(loading-icon) {
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
font-size: var(--el-font-size-base);
|
font-size: var(--el-font-size-base);
|
||||||
color: $--tree-expand-icon-color;
|
color: var(--el-tree-expand-icon-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
& > .#{$namespace}-tree-node__children {
|
& > .#{$namespace}-tree-node__children {
|
||||||
@ -122,5 +128,5 @@
|
|||||||
.#{$namespace}-tree--highlight-current
|
.#{$namespace}-tree--highlight-current
|
||||||
.#{$namespace}-tree-node.is-current
|
.#{$namespace}-tree-node.is-current
|
||||||
> .#{$namespace}-tree-node__content {
|
> .#{$namespace}-tree-node__content {
|
||||||
background-color: mix($--color-white, $--color-primary, 92%);
|
background-color: var(--el-color-primary-light-9);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user