Skip to content

Commit 6179d89

Browse files
author
weilei
committed
feat: 更新颜色变量为SCSS主题变量,优化样式结构
1 parent 7666945 commit 6179d89

File tree

3 files changed

+28
-19
lines changed

3 files changed

+28
-19
lines changed

packages/element-x-ui/src/components/ThoughtChain/main.vue

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
<script>
5353
import { get } from 'lodash'
5454
import ElXTypewriter from '../Typewriter/main.vue'
55-
5655
export default {
5756
name: 'ElXThoughtChain',
5857
components: {
@@ -120,11 +119,12 @@ export default {
120119
data() {
121120
return {
122121
colorArr: {
123-
info: 'var(--el-color-primary)',
124-
success: 'var(--el-color-success)',
125-
warning: 'var(--el-color-warning)',
126-
danger: 'var(--el-color-danger)',
127-
primary: 'var(--el-color-primary)',
122+
// 使用与SCSS变量对应的字符串表示
123+
info: 'var(--color-info, #909399)',
124+
success: 'var(--color-success, #67C23A)',
125+
warning: 'var(--color-warning, #E6A23C)',
126+
danger: 'var(--color-danger, #F56C6C)',
127+
primary: 'var(--color-primary, #409EFF)',
128128
},
129129
defaultActiveNodes: [],
130130
}
@@ -200,8 +200,6 @@ export default {
200200
getEle() {
201201
if (this.getLineColor && this.$refs.timelineRef && this.lineGradient) {
202202
const ele = this.$refs.timelineRef.$el.children[0].children
203-
console.log(ele)
204-
205203
this.setRadialGradient(this.getLineColor, ele)
206204
}
207205
},

packages/element-x-ui/src/styles/ThoughtChain.scss

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
.el-button {
1010
cursor: default !important;
1111

12-
&:active {
13-
background-color: $--el-x-fill-color !important;
14-
border-color: $--el-x-fill-color !important;
15-
}
16-
17-
&:hover {
18-
background-color: $--el-x-fill-color !important;
19-
border-color: $--el-x-fill-color !important;
20-
}
12+
// &:active {
13+
// background-color: $--el-x-fill-color !important;
14+
// border-color: $--el-x-fill-color !important;
15+
// }
16+
17+
// &:hover {
18+
// background-color: $--el-x-fill-color !important;
19+
// border-color: $--el-x-fill-color !important;
20+
// }
2121
}
2222
}
2323

@@ -110,5 +110,4 @@
110110
100% {
111111
transform: rotate(360deg);
112112
}
113-
}
114-
113+
}

packages/element-x-ui/src/theme/var.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
@import "~element-ui/packages/theme-chalk/src/common/var";
22

3+
:root {
4+
--color-primary: #{$--color-primary};
5+
--color-success: #{$--color-success};
6+
--color-warning: #{$--color-warning};
7+
--color-danger: #{$--color-danger};
8+
--color-info: #{$--color-info};
9+
10+
$--el-x-color-primary: $--color-primary;
11+
$--el-x-color-success: $--color-success;
12+
}
13+
314
$--el-x-color-primary: $--color-primary;
15+
$--el-x-color-success: $--color-success;
416
// 字体大小
517
$--el-x-font-size-small: $--font-size-small !default;
618
$--el-x-font-size-base: $--font-size-base !default;

0 commit comments

Comments
 (0)