Skip to content

Commit 519d9c2

Browse files
committed
fix: change theme
1 parent 0c09378 commit 519d9c2

File tree

2 files changed

+73
-10
lines changed

2 files changed

+73
-10
lines changed

packages/theme/src/fluent-editor/index.less

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
11
@import '../custom.less';
22
@import '../mixins/common.less';
3+
@import './vars.less';
34

45
@editor-wrapper-prefix-cls: ~'@{css-prefix}editor-wrapper';
56
@editor-prefix-cls: ~'@{css-prefix}editor';
67

78
.@{editor-wrapper-prefix-cls} {
9+
.inject-FluentEditor-vars();
10+
811
border: 1px solid #ddd;
912
border-radius: 4px;
1013

1114
.ql-toolbar.ql-snow {
1215
padding: 8px 16px 4px 16px;
1316
border: none;
1417

18+
svg {
19+
font-size: 16px;
20+
21+
path {
22+
fill: var(--tv-FluentEditor-select-icon-color);
23+
24+
&:hover,
25+
&:focus {
26+
fill: var(--tv-FluentEditor-select-icon-color-hover);
27+
}
28+
}
29+
}
30+
1531
.ql-formats {
1632
margin-right: 16px;
1733
margin-bottom: 4px;
@@ -46,28 +62,36 @@
4662
span.ql-lineheight,
4763
span.ql-header {
4864
.ql-picker-label {
49-
color: #191919;
65+
color: var(--tv-FluentEditor-selected-text-color);
5066
border: 1px solid transparent;
5167
border-radius: 2px;
5268

5369
> svg {
5470
display: none;
5571
}
5672

73+
&:hover {
74+
border-color: var(--tv-FluentEditor-select-border-color-hover);
75+
}
76+
5777
&::after {
78+
display: inline-block;
5879
content: '';
5980
position: absolute;
60-
width: 14px;
61-
height: 14px;
81+
width: 8px;
82+
height: 8px;
6283
right: 8px;
63-
top: calc(50% + 1px);
64-
transform: translateY(-50%);
65-
background: url(../images/chevron-down.svg) no-repeat center/100%;
84+
top: calc(50% - 5px);
85+
border-color: var(--tv-FluentEditor-select-box-icon-color);
86+
border-style: solid;
87+
border-width: 0 2px 2px 0;
88+
transform: rotate(45deg);
6689
}
6790
}
6891

6992
.ql-picker-label:hover {
70-
border-color: #191919;
93+
border-color: var(--tv-FluentEditor-select-border-color-hover);
94+
color: var(--tv-FluentEditor-select-text-color);
7195
}
7296
}
7397

@@ -104,13 +128,16 @@
104128
.ql-picker-options {
105129
padding: 3px 5px;
106130
border: none;
131+
background-color: var(--tv-FluentEditor-select-bg-color);
132+
border-radius: var(--tv-FluentEditor-select-border-radius);
133+
box-shadow: var(--tv-FluentEditor-select-box-shadow);
107134

108135
> .ql-picker-item {
109-
color: #191919;
136+
color: var(--tv-FluentEditor-select-text-color);
110137

111138
&:hover {
112-
background-color: rgba(25, 25, 25, 0.1);
113-
color: #191919;
139+
background-color: var(--tv-FluentEditor-select-bg-color-hover);
140+
color: var(--tv-FluentEditor-select-active-text-color);
114141
}
115142

116143
&::after {
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* Copyright (c) 2022 - present TinyVue Authors.
3+
* Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
4+
*
5+
* Use of this source code is governed by an MIT-style license.
6+
*
7+
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
8+
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
9+
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
10+
*
11+
*/
12+
13+
.inject-FluentEditor-vars() {
14+
// 富文本图标颜色
15+
--tv-FluentEditor-select-icon-color: var(--tv-color-icon);
16+
// 富文本图标悬浮颜色
17+
--tv-FluentEditor-select-icon-color-hover: var(--tv-color-icon-hover);
18+
// 富文本下拉选项背景色
19+
--tv-FluentEditor-select-bg-color: var(--tv-color-bg-2);
20+
// 富文本下拉选项选中悬浮背景色
21+
--tv-FluentEditor-select-bg-color-hover: var(--tv-color-bg-hover);
22+
// 富文本下拉选项文字
23+
--tv-FluentEditor-select-text-color: var(--tv-color-text);
24+
// 富文本下拉选项文字边框
25+
--tv-FluentEditor-select-border-color-hover: var(--tv-color-border-hover);
26+
// 富文本下拉已选文字颜色
27+
--tv-FluentEditor-selected-text-color: var(--tv-color-text-secondary);
28+
// 富文本下拉选项选中文字颜色
29+
--tv-FluentEditor-select-active-text-color: var(--tv-color-text-active);
30+
// 富文本下拉选项面板圆角半径
31+
--tv-FluentEditor-select-border-radius: var(--tv-border-radius-md);
32+
// 富文本下拉选项面板阴影
33+
--tv-FluentEditor-select-box-shadow: var(--tv-shadow-2-down);
34+
// 富文本下拉框的图标颜色
35+
--tv-FluentEditor-select-box-icon-color: var(--tv-color-icon);
36+
}

0 commit comments

Comments
 (0)