@ew-color-picker/style 2.0.13 → 2.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all.css +2629 -0
- package/dist/all.min.css +1 -0
- package/dist/button.css +56 -21
- package/dist/button.min.css +1 -1
- package/dist/checkbox.css +37 -11
- package/dist/checkbox.min.css +1 -1
- package/dist/index.css +125 -13
- package/dist/index.min.css +1 -1
- package/dist/input-number.css +241 -9
- package/dist/input-number.min.css +1 -1
- package/dist/input.css +51 -10
- package/dist/input.min.css +1 -1
- package/dist/select.css +47 -20
- package/dist/select.min.css +1 -1
- package/dist/tooltip.css +10 -5
- package/dist/tooltip.min.css +1 -1
- package/package.json +1 -1
- package/src/all.scss +10 -0
- package/src/button.scss +58 -21
- package/src/checkbox.scss +37 -11
- package/src/index.scss +152 -13
- package/src/input-number.scss +226 -9
- package/src/input.scss +52 -10
- package/src/select.scss +47 -20
- package/src/tooltip.scss +12 -5
package/dist/select.css
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
1
2
|
.ew-select {
|
|
2
3
|
position: relative;
|
|
3
4
|
display: inline-block;
|
|
@@ -15,10 +16,10 @@
|
|
|
15
16
|
width: 100%;
|
|
16
17
|
height: var(--select-height, 32px);
|
|
17
18
|
padding: var(--select-padding, 0 10px);
|
|
18
|
-
border: var(--select-border-width, 1.5px) solid #d9d9d9;
|
|
19
|
+
border: var(--select-border-width, 1.5px) solid var(--ewcp-color-border, #d9d9d9);
|
|
19
20
|
border-radius: var(--select-radius, 8px);
|
|
20
|
-
background: #fff;
|
|
21
|
-
color: #222;
|
|
21
|
+
background: var(--ewcp-color-bg, #fff);
|
|
22
|
+
color: var(--ewcp-color-text, #222);
|
|
22
23
|
font-family: inherit;
|
|
23
24
|
font-size: var(--select-font-size, 14px);
|
|
24
25
|
line-height: 1;
|
|
@@ -30,11 +31,11 @@
|
|
|
30
31
|
|
|
31
32
|
.ew-select__trigger:focus {
|
|
32
33
|
outline: none;
|
|
33
|
-
border-color: #4096ef;
|
|
34
|
+
border-color: var(--ewcp-color-primary, #4096ef);
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
.ew-select--open .ew-select__trigger {
|
|
37
|
-
border-color: #4096ef;
|
|
38
|
+
border-color: var(--ewcp-color-primary, #4096ef);
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
.ew-select__value {
|
|
@@ -46,7 +47,14 @@
|
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
.ew-select__value--placeholder {
|
|
49
|
-
color: #999;
|
|
50
|
+
color: var(--ewcp-color-text-tertiary, #999);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* 富内容(节点 / HTML):图标与文字水平居中对齐 */
|
|
54
|
+
.ew-select__value--rich {
|
|
55
|
+
display: inline-flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
gap: 6px;
|
|
50
58
|
}
|
|
51
59
|
|
|
52
60
|
.ew-select__clear {
|
|
@@ -56,14 +64,14 @@
|
|
|
56
64
|
flex: 0 0 var(--select-clear-size, 12px);
|
|
57
65
|
width: var(--select-clear-size, 12px);
|
|
58
66
|
height: var(--select-clear-size, 12px);
|
|
59
|
-
color: #999;
|
|
67
|
+
color: var(--ewcp-color-text-tertiary, #999);
|
|
60
68
|
border-radius: 50%;
|
|
61
69
|
cursor: pointer;
|
|
62
70
|
transition: color 0.15s;
|
|
63
71
|
}
|
|
64
72
|
|
|
65
73
|
.ew-select__clear:hover {
|
|
66
|
-
color: #666;
|
|
74
|
+
color: var(--ewcp-color-text-secondary, #666);
|
|
67
75
|
}
|
|
68
76
|
|
|
69
77
|
.ew-select__clear--hidden {
|
|
@@ -84,7 +92,7 @@
|
|
|
84
92
|
flex: 0 0 var(--select-arrow-size, 12px);
|
|
85
93
|
width: var(--select-arrow-size, 12px);
|
|
86
94
|
height: var(--select-arrow-size, 12px);
|
|
87
|
-
color: #999;
|
|
95
|
+
color: var(--ewcp-color-text-tertiary, #999);
|
|
88
96
|
transition: transform 0.2s;
|
|
89
97
|
}
|
|
90
98
|
|
|
@@ -104,15 +112,15 @@
|
|
|
104
112
|
top: calc(100% + 4px);
|
|
105
113
|
left: 0;
|
|
106
114
|
right: 0;
|
|
107
|
-
z-index: 3;
|
|
115
|
+
z-index: var(--ewcp-z-popper, 3);
|
|
108
116
|
display: none;
|
|
109
117
|
max-height: 200px;
|
|
110
118
|
overflow-y: auto;
|
|
111
119
|
padding: 4px;
|
|
112
|
-
border: 1px solid #e5e6eb;
|
|
120
|
+
border: 1px solid var(--ewcp-color-border-light, #e5e6eb);
|
|
113
121
|
border-radius: 8px;
|
|
114
|
-
background: #fff;
|
|
115
|
-
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
122
|
+
background: var(--ewcp-color-bg, #fff);
|
|
123
|
+
box-shadow: var(--ewcp-shadow-popper, 0 4px 16px rgba(0, 0, 0, 0.12));
|
|
116
124
|
box-sizing: border-box;
|
|
117
125
|
}
|
|
118
126
|
|
|
@@ -120,10 +128,22 @@
|
|
|
120
128
|
display: block;
|
|
121
129
|
}
|
|
122
130
|
|
|
131
|
+
.ew-select__dropdown--open {
|
|
132
|
+
display: block;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.ew-select__empty,
|
|
136
|
+
.ew-select__loading {
|
|
137
|
+
padding: 8px 10px;
|
|
138
|
+
color: var(--ewcp-color-text-tertiary, #999);
|
|
139
|
+
font-size: 13px;
|
|
140
|
+
text-align: center;
|
|
141
|
+
}
|
|
142
|
+
|
|
123
143
|
.ew-select__option {
|
|
124
144
|
padding: 6px 10px;
|
|
125
145
|
border-radius: 6px;
|
|
126
|
-
color: #333;
|
|
146
|
+
color: var(--ewcp-color-text, #333);
|
|
127
147
|
font-size: 13px;
|
|
128
148
|
line-height: 20px;
|
|
129
149
|
white-space: nowrap;
|
|
@@ -133,18 +153,25 @@
|
|
|
133
153
|
transition: background 0.15s;
|
|
134
154
|
}
|
|
135
155
|
|
|
156
|
+
.ew-select__option--rich {
|
|
157
|
+
display: flex;
|
|
158
|
+
align-items: center;
|
|
159
|
+
gap: 6px;
|
|
160
|
+
text-overflow: clip;
|
|
161
|
+
}
|
|
162
|
+
|
|
136
163
|
.ew-select__option:hover,
|
|
137
164
|
.ew-select__option--active {
|
|
138
|
-
background: #f0f8ff;
|
|
165
|
+
background: var(--ewcp-color-bg-hover, #f0f8ff);
|
|
139
166
|
}
|
|
140
167
|
|
|
141
168
|
.ew-select__option--selected {
|
|
142
|
-
color: #4096ef;
|
|
169
|
+
color: var(--ewcp-color-primary, #4096ef);
|
|
143
170
|
font-weight: 500;
|
|
144
171
|
}
|
|
145
172
|
|
|
146
173
|
.ew-select__option--disabled {
|
|
147
|
-
color: #ccc;
|
|
174
|
+
color: var(--ewcp-color-text-disabled, #ccc);
|
|
148
175
|
background: transparent;
|
|
149
176
|
cursor: not-allowed;
|
|
150
177
|
}
|
|
@@ -154,9 +181,9 @@
|
|
|
154
181
|
}
|
|
155
182
|
|
|
156
183
|
.ew-select--disabled .ew-select__trigger {
|
|
157
|
-
border-color: #e5e6eb;
|
|
158
|
-
background: #f7f8fa;
|
|
159
|
-
color: #ccc;
|
|
184
|
+
border-color: var(--ewcp-color-border-light, #e5e6eb);
|
|
185
|
+
background: var(--ewcp-color-bg-disabled, #f7f8fa);
|
|
186
|
+
color: var(--ewcp-color-text-disabled, #ccc);
|
|
160
187
|
cursor: not-allowed;
|
|
161
188
|
}
|
|
162
189
|
|
package/dist/select.min.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.ew-select{position:relative;display:inline-block;width:100%;min-width:0;font-family:inherit;box-sizing:border-box}.ew-select__trigger{display:flex;align-items:center;justify-content:space-between;gap:4px;width:100%;height:var(--select-height, 32px);padding:var(--select-padding, 0 10px);border:var(--select-border-width, 1.5px) solid #d9d9d9;border-radius:var(--select-radius, 8px);background
|
|
1
|
+
.ew-select{position:relative;display:inline-block;width:100%;min-width:0;font-family:inherit;box-sizing:border-box}.ew-select__trigger{display:flex;align-items:center;justify-content:space-between;gap:4px;width:100%;height:var(--select-height, 32px);padding:var(--select-padding, 0 10px);border:var(--select-border-width, 1.5px) solid var(--ewcp-color-border, #d9d9d9);border-radius:var(--select-radius, 8px);background:var(--ewcp-color-bg, #fff);color:var(--ewcp-color-text, #222);font-family:inherit;font-size:var(--select-font-size, 14px);line-height:1;text-align:left;cursor:pointer;box-sizing:border-box;transition:border-color .2s}.ew-select__trigger:focus{outline:none;border-color:var(--ewcp-color-primary, #4096ef)}.ew-select--open .ew-select__trigger{border-color:var(--ewcp-color-primary, #4096ef)}.ew-select__value{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ew-select__value--placeholder{color:var(--ewcp-color-text-tertiary, #999)}.ew-select__value--rich{display:inline-flex;align-items:center;gap:6px}.ew-select__clear{display:inline-flex;align-items:center;justify-content:center;flex:0 0 var(--select-clear-size, 12px);width:var(--select-clear-size, 12px);height:var(--select-clear-size, 12px);color:var(--ewcp-color-text-tertiary, #999);border-radius:50%;cursor:pointer;transition:color .15s}.ew-select__clear:hover{color:var(--ewcp-color-text-secondary, #666)}.ew-select__clear--hidden{display:none}.ew-select__clear-icon{display:block;width:var(--select-clear-size, 12px);height:var(--select-clear-size, 12px);pointer-events:none}.ew-select__arrow{display:flex;align-items:center;justify-content:center;flex:0 0 var(--select-arrow-size, 12px);width:var(--select-arrow-size, 12px);height:var(--select-arrow-size, 12px);color:var(--ewcp-color-text-tertiary, #999);transition:transform .2s}.ew-select--open .ew-select__arrow{transform:rotate(180deg)}.ew-select__arrow-icon{display:block;width:var(--select-arrow-size, 12px);height:var(--select-arrow-size, 12px);pointer-events:none}.ew-select__dropdown{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:var(--ewcp-z-popper, 3);display:none;max-height:200px;overflow-y:auto;padding:4px;border:1px solid var(--ewcp-color-border-light, #e5e6eb);border-radius:8px;background:var(--ewcp-color-bg, #fff);box-shadow:var(--ewcp-shadow-popper, 0 4px 16px rgba(0, 0, 0, 0.12));box-sizing:border-box}.ew-select--open .ew-select__dropdown{display:block}.ew-select__dropdown--open{display:block}.ew-select__empty,.ew-select__loading{padding:8px 10px;color:var(--ewcp-color-text-tertiary, #999);font-size:13px;text-align:center}.ew-select__option{padding:6px 10px;border-radius:6px;color:var(--ewcp-color-text, #333);font-size:13px;line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;transition:background .15s}.ew-select__option--rich{display:flex;align-items:center;gap:6px;text-overflow:clip}.ew-select__option:hover,.ew-select__option--active{background:var(--ewcp-color-bg-hover, #f0f8ff)}.ew-select__option--selected{color:var(--ewcp-color-primary, #4096ef);font-weight:500}.ew-select__option--disabled{color:var(--ewcp-color-text-disabled, #ccc);background:rgba(0,0,0,0);cursor:not-allowed}.ew-select--disabled{cursor:not-allowed}.ew-select--disabled .ew-select__trigger{border-color:var(--ewcp-color-border-light, #e5e6eb);background:var(--ewcp-color-bg-disabled, #f7f8fa);color:var(--ewcp-color-text-disabled, #ccc);cursor:not-allowed}.ew-select--small .ew-select__trigger{height:24px;padding:0 8px;font-size:12px;border-radius:6px}.ew-select--small .ew-select__option{padding:4px 8px;font-size:12px}.ew-select--large .ew-select__trigger{height:40px;padding:0 12px;font-size:15px}.ew-select--large .ew-select__option{padding:8px 12px;font-size:14px}
|
package/dist/tooltip.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.ew-tooltip {
|
|
2
2
|
position: fixed;
|
|
3
|
-
z-index: 3000;
|
|
3
|
+
z-index: var(--ewcp-z-tooltip, 3000);
|
|
4
4
|
box-sizing: border-box;
|
|
5
5
|
max-width: var(--ew-tooltip-max-width, none);
|
|
6
6
|
padding: 5px 10px;
|
|
@@ -24,12 +24,17 @@
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
.ew-tooltip--light {
|
|
27
|
-
--ew-tooltip-bg: #fff;
|
|
28
|
-
--ew-tooltip-color: #303133;
|
|
29
|
-
--ew-tooltip-border-color: #e4e7ed;
|
|
30
|
-
--ew-tooltip-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
|
27
|
+
--ew-tooltip-bg: var(--ewcp-color-bg, #fff);
|
|
28
|
+
--ew-tooltip-color: var(--ewcp-color-text, #303133);
|
|
29
|
+
--ew-tooltip-border-color: var(--ewcp-color-border-light, #e4e7ed);
|
|
30
|
+
--ew-tooltip-shadow: var(--ewcp-shadow-popper, 0 2px 12px rgba(0, 0, 0, 0.1));
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
@media (prefers-reduced-motion: reduce) {
|
|
34
|
+
.ew-tooltip {
|
|
35
|
+
transition: none;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
33
38
|
.ew-tooltip--dark,
|
|
34
39
|
.ew-tooltip--light {
|
|
35
40
|
background: var(--ew-tooltip-bg);
|
package/dist/tooltip.min.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.ew-tooltip{position:fixed;z-index:3000;box-sizing:border-box;max-width:var(--ew-tooltip-max-width, none);padding:5px 10px;border-radius:4px;font-family:inherit;font-size:12px;line-height:1.4;text-align:left;word-break:break-word;pointer-events:none;opacity:0;visibility:hidden;transition:opacity .2s ease,visibility .2s ease}.ew-tooltip--dark{--ew-tooltip-bg: #303133;--ew-tooltip-color: #fff;--ew-tooltip-border-color: transparent;--ew-tooltip-shadow: 0 2px 12px rgba(0, 0, 0, 0.2)}.ew-tooltip--light{--ew-tooltip-bg: #fff;--ew-tooltip-color: #303133;--ew-tooltip-border-color: #e4e7ed;--ew-tooltip-shadow: 0 2px 12px rgba(0, 0, 0, 0.1)}.ew-tooltip--dark,.ew-tooltip--light{background:var(--ew-tooltip-bg);color:var(--ew-tooltip-color);border:1px solid var(--ew-tooltip-border-color);box-shadow:var(--ew-tooltip-shadow)}.ew-tooltip--visible{opacity:1;visibility:visible}.ew-tooltip--enterable{pointer-events:auto}.ew-tooltip__content{display:block}.ew-tooltip__arrow{position:absolute;width:8px;height:8px;box-sizing:border-box;background:inherit;border:1px solid rgba(0,0,0,0);border-color:rgba(0,0,0,0);transform:rotate(45deg);pointer-events:none;z-index:-1}.ew-tooltip[data-placement^=top] .ew-tooltip__arrow{border-right-color:var(--ew-tooltip-border-color);border-bottom-color:var(--ew-tooltip-border-color)}.ew-tooltip[data-placement^=bottom] .ew-tooltip__arrow{border-left-color:var(--ew-tooltip-border-color);border-top-color:var(--ew-tooltip-border-color)}.ew-tooltip[data-placement^=left] .ew-tooltip__arrow{border-top-color:var(--ew-tooltip-border-color);border-right-color:var(--ew-tooltip-border-color)}.ew-tooltip[data-placement^=right] .ew-tooltip__arrow{border-left-color:var(--ew-tooltip-border-color);border-bottom-color:var(--ew-tooltip-border-color)}
|
|
1
|
+
.ew-tooltip{position:fixed;z-index:var(--ewcp-z-tooltip, 3000);box-sizing:border-box;max-width:var(--ew-tooltip-max-width, none);padding:5px 10px;border-radius:4px;font-family:inherit;font-size:12px;line-height:1.4;text-align:left;word-break:break-word;pointer-events:none;opacity:0;visibility:hidden;transition:opacity .2s ease,visibility .2s ease}.ew-tooltip--dark{--ew-tooltip-bg: #303133;--ew-tooltip-color: #fff;--ew-tooltip-border-color: transparent;--ew-tooltip-shadow: 0 2px 12px rgba(0, 0, 0, 0.2)}.ew-tooltip--light{--ew-tooltip-bg: var(--ewcp-color-bg, #fff);--ew-tooltip-color: var(--ewcp-color-text, #303133);--ew-tooltip-border-color: var(--ewcp-color-border-light, #e4e7ed);--ew-tooltip-shadow: var(--ewcp-shadow-popper, 0 2px 12px rgba(0, 0, 0, 0.1))}@media(prefers-reduced-motion: reduce){.ew-tooltip{transition:none}}.ew-tooltip--dark,.ew-tooltip--light{background:var(--ew-tooltip-bg);color:var(--ew-tooltip-color);border:1px solid var(--ew-tooltip-border-color);box-shadow:var(--ew-tooltip-shadow)}.ew-tooltip--visible{opacity:1;visibility:visible}.ew-tooltip--enterable{pointer-events:auto}.ew-tooltip__content{display:block}.ew-tooltip__arrow{position:absolute;width:8px;height:8px;box-sizing:border-box;background:inherit;border:1px solid rgba(0,0,0,0);border-color:rgba(0,0,0,0);transform:rotate(45deg);pointer-events:none;z-index:-1}.ew-tooltip[data-placement^=top] .ew-tooltip__arrow{border-right-color:var(--ew-tooltip-border-color);border-bottom-color:var(--ew-tooltip-border-color)}.ew-tooltip[data-placement^=bottom] .ew-tooltip__arrow{border-left-color:var(--ew-tooltip-border-color);border-top-color:var(--ew-tooltip-border-color)}.ew-tooltip[data-placement^=left] .ew-tooltip__arrow{border-top-color:var(--ew-tooltip-border-color);border-right-color:var(--ew-tooltip-border-color)}.ew-tooltip[data-placement^=right] .ew-tooltip__arrow{border-left-color:var(--ew-tooltip-border-color);border-bottom-color:var(--ew-tooltip-border-color)}
|
package/package.json
CHANGED
package/src/all.scss
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// 聚合样式入口:一次引入核心与全部插件/组件样式。
|
|
2
|
+
// 适合「不想逐个确认依赖」的场景(例如 select 需要同时引入 tooltip 样式);
|
|
3
|
+
// 只想按需加载时仍可单独引入 index.css、select.css 等。
|
|
4
|
+
@import './index.scss';
|
|
5
|
+
@import './input-number.scss';
|
|
6
|
+
@import './select.scss';
|
|
7
|
+
@import './checkbox.scss';
|
|
8
|
+
@import './tooltip.scss';
|
|
9
|
+
@import './input.scss';
|
|
10
|
+
@import './button.scss';
|
package/src/button.scss
CHANGED
|
@@ -6,13 +6,14 @@ $prefix: "ew-" !default;
|
|
|
6
6
|
display: inline-flex;
|
|
7
7
|
align-items: center;
|
|
8
8
|
justify-content: center;
|
|
9
|
+
gap: 6px;
|
|
9
10
|
height: 32px;
|
|
10
11
|
padding: 0 15px;
|
|
11
12
|
box-sizing: border-box;
|
|
12
|
-
border: 1px solid #dcdfe6;
|
|
13
|
+
border: 1px solid var(--ewcp-color-border, #dcdfe6);
|
|
13
14
|
border-radius: var(--btn-radius, 4px);
|
|
14
|
-
background: #fff;
|
|
15
|
-
color: #606266;
|
|
15
|
+
background: var(--ewcp-color-bg, #fff);
|
|
16
|
+
color: var(--ewcp-color-text-secondary, #606266);
|
|
16
17
|
font-family: inherit;
|
|
17
18
|
font-size: 14px;
|
|
18
19
|
line-height: 1;
|
|
@@ -23,44 +24,80 @@ $prefix: "ew-" !default;
|
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
.#{$prefix}button:hover {
|
|
26
|
-
border-color: #4096ef;
|
|
27
|
-
color: #4096ef;
|
|
27
|
+
border-color: var(--ewcp-color-primary, #4096ef);
|
|
28
|
+
color: var(--ewcp-color-primary, #4096ef);
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
.#{$prefix}button--primary {
|
|
31
|
-
border-color: #4096ef;
|
|
32
|
-
background: #4096ef;
|
|
33
|
-
color: #fff;
|
|
32
|
+
border-color: var(--ewcp-color-primary, #4096ef);
|
|
33
|
+
background: var(--ewcp-color-primary, #4096ef);
|
|
34
|
+
color: var(--ewcp-color-bg, #fff);
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
.#{$prefix}button--primary:hover {
|
|
37
|
-
border-color: #66b1ff;
|
|
38
|
-
background: #66b1ff;
|
|
39
|
-
color: #fff;
|
|
38
|
+
border-color: var(--ewcp-color-primary-hover, #66b1ff);
|
|
39
|
+
background: var(--ewcp-color-primary-hover, #66b1ff);
|
|
40
|
+
color: var(--ewcp-color-bg, #fff);
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
.#{$prefix}button--danger {
|
|
43
|
-
border-color: #f56c6c;
|
|
44
|
-
background: #f56c6c;
|
|
45
|
-
color: #fff;
|
|
44
|
+
border-color: var(--ewcp-color-danger, #f56c6c);
|
|
45
|
+
background: var(--ewcp-color-danger, #f56c6c);
|
|
46
|
+
color: var(--ewcp-color-bg, #fff);
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
.#{$prefix}button--danger:hover {
|
|
49
50
|
border-color: #f78989;
|
|
50
51
|
background: #f78989;
|
|
51
|
-
color: #fff;
|
|
52
|
+
color: var(--ewcp-color-bg, #fff);
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
.#{$prefix}button--text {
|
|
55
56
|
border-color: transparent;
|
|
56
57
|
background: transparent;
|
|
57
|
-
color: #4096ef;
|
|
58
|
+
color: var(--ewcp-color-primary, #4096ef);
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
.#{$prefix}button--text:hover {
|
|
61
62
|
border-color: transparent;
|
|
62
63
|
background: transparent;
|
|
63
|
-
color: #66b1ff;
|
|
64
|
+
color: var(--ewcp-color-primary-hover, #66b1ff);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// ghost:描边风格,透明底
|
|
68
|
+
.#{$prefix}button--ghost {
|
|
69
|
+
border-color: var(--ewcp-color-primary, #4096ef);
|
|
70
|
+
background: transparent;
|
|
71
|
+
color: var(--ewcp-color-primary, #4096ef);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.#{$prefix}button--ghost:hover {
|
|
75
|
+
border-color: var(--ewcp-color-primary, #4096ef);
|
|
76
|
+
background: rgba(64, 150, 239, 0.08);
|
|
77
|
+
color: var(--ewcp-color-primary, #4096ef);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// link:纯文字链接风格
|
|
81
|
+
.#{$prefix}button--link {
|
|
82
|
+
border-color: transparent;
|
|
83
|
+
background: transparent;
|
|
84
|
+
color: var(--ewcp-color-primary, #4096ef);
|
|
85
|
+
text-decoration: none;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.#{$prefix}button--link:hover {
|
|
89
|
+
border-color: transparent;
|
|
90
|
+
background: transparent;
|
|
91
|
+
color: var(--ewcp-color-primary-hover, #66b1ff);
|
|
92
|
+
text-decoration: underline;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
a.#{$prefix}button {
|
|
96
|
+
text-decoration: none;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
a.#{$prefix}button--disabled {
|
|
100
|
+
pointer-events: none;
|
|
64
101
|
}
|
|
65
102
|
|
|
66
103
|
.#{$prefix}button--small {
|
|
@@ -82,9 +119,9 @@ $prefix: "ew-" !default;
|
|
|
82
119
|
|
|
83
120
|
.#{$prefix}button:disabled,
|
|
84
121
|
.#{$prefix}button--disabled {
|
|
85
|
-
border-color: #e4e7ed;
|
|
86
|
-
background: #f5f7fa;
|
|
87
|
-
color: #c0c4cc;
|
|
122
|
+
border-color: var(--ewcp-color-border-light, #e4e7ed);
|
|
123
|
+
background: var(--ewcp-color-bg-disabled, #f5f7fa);
|
|
124
|
+
color: var(--ewcp-color-text-disabled, #c0c4cc);
|
|
88
125
|
cursor: not-allowed;
|
|
89
126
|
}
|
|
90
127
|
|
|
@@ -92,5 +129,5 @@ $prefix: "ew-" !default;
|
|
|
92
129
|
.#{$prefix}button--danger:disabled {
|
|
93
130
|
border-color: #a0cfff;
|
|
94
131
|
background: #a0cfff;
|
|
95
|
-
color: #fff;
|
|
132
|
+
color: var(--ewcp-color-bg, #fff);
|
|
96
133
|
}
|
package/src/checkbox.scss
CHANGED
|
@@ -7,7 +7,7 @@ $prefix: "ew-" !default;
|
|
|
7
7
|
display: inline-flex;
|
|
8
8
|
align-items: center;
|
|
9
9
|
gap: var(--checkbox-gap, 6px);
|
|
10
|
-
color: #666;
|
|
10
|
+
color: var(--ewcp-color-text-secondary, #666);
|
|
11
11
|
font-family: inherit;
|
|
12
12
|
font-size: var(--checkbox-font-size, 12px);
|
|
13
13
|
line-height: 1;
|
|
@@ -17,6 +17,13 @@ $prefix: "ew-" !default;
|
|
|
17
17
|
box-sizing: border-box;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
/* 标签支持插入图标等节点,与文字水平居中对齐 */
|
|
21
|
+
.#{$prefix}checkbox__label {
|
|
22
|
+
display: inline-flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
gap: var(--checkbox-gap, 6px);
|
|
25
|
+
}
|
|
26
|
+
|
|
20
27
|
// 原生 input 只保留语义与键盘能力,视觉交给自定义方块
|
|
21
28
|
.#{$prefix}checkbox__input {
|
|
22
29
|
position: absolute;
|
|
@@ -39,9 +46,9 @@ $prefix: "ew-" !default;
|
|
|
39
46
|
flex: 0 0 var(--checkbox-box-size, 16px);
|
|
40
47
|
width: var(--checkbox-box-size, 16px);
|
|
41
48
|
height: var(--checkbox-box-size, 16px);
|
|
42
|
-
border: var(--checkbox-border-width, 1.5px) solid #d9d9d9;
|
|
49
|
+
border: var(--checkbox-border-width, 1.5px) solid var(--ewcp-color-checkbox-border, #d9d9d9);
|
|
43
50
|
border-radius: var(--checkbox-box-radius, 4px);
|
|
44
|
-
background: #fff;
|
|
51
|
+
background: var(--ewcp-color-bg, #fff);
|
|
45
52
|
box-sizing: border-box;
|
|
46
53
|
transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
|
|
47
54
|
}
|
|
@@ -50,15 +57,15 @@ $prefix: "ew-" !default;
|
|
|
50
57
|
display: block;
|
|
51
58
|
width: var(--checkbox-icon-size, 10px);
|
|
52
59
|
height: var(--checkbox-icon-size, 10px);
|
|
53
|
-
color: #fff;
|
|
60
|
+
color: var(--ewcp-color-bg, #fff);
|
|
54
61
|
opacity: 0;
|
|
55
62
|
pointer-events: none;
|
|
56
63
|
transition: opacity 0.15s;
|
|
57
64
|
}
|
|
58
65
|
|
|
59
66
|
.#{$prefix}checkbox__input:checked + .#{$prefix}checkbox__box {
|
|
60
|
-
border-color: #4096ef;
|
|
61
|
-
background: #4096ef;
|
|
67
|
+
border-color: var(--ewcp-color-primary, #4096ef);
|
|
68
|
+
background: var(--ewcp-color-primary, #4096ef);
|
|
62
69
|
}
|
|
63
70
|
|
|
64
71
|
.#{$prefix}checkbox__input:checked + .#{$prefix}checkbox__box .#{$prefix}checkbox__check-icon {
|
|
@@ -69,19 +76,38 @@ $prefix: "ew-" !default;
|
|
|
69
76
|
box-shadow: 0 0 0 2px rgba(64, 150, 239, 0.18);
|
|
70
77
|
}
|
|
71
78
|
|
|
79
|
+
// 半选态:视觉显示横杠,优先级高于勾选态
|
|
80
|
+
.#{$prefix}checkbox--indeterminate .#{$prefix}checkbox__box {
|
|
81
|
+
border-color: var(--ewcp-color-primary, #4096ef);
|
|
82
|
+
background: var(--ewcp-color-primary, #4096ef);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.#{$prefix}checkbox__indeterminate-icon {
|
|
86
|
+
display: block;
|
|
87
|
+
width: var(--checkbox-icon-size, 10px);
|
|
88
|
+
height: var(--checkbox-icon-size, 10px);
|
|
89
|
+
color: var(--ewcp-color-bg, #fff);
|
|
90
|
+
pointer-events: none;
|
|
91
|
+
}
|
|
92
|
+
|
|
72
93
|
.#{$prefix}checkbox--disabled {
|
|
73
|
-
color: #ccc;
|
|
94
|
+
color: var(--ewcp-color-text-disabled, #ccc);
|
|
74
95
|
cursor: not-allowed;
|
|
75
96
|
}
|
|
76
97
|
|
|
77
98
|
.#{$prefix}checkbox--disabled .#{$prefix}checkbox__box {
|
|
78
|
-
border-color: #e5e6eb;
|
|
79
|
-
background: #f7f8fa;
|
|
99
|
+
border-color: var(--ewcp-color-border-light, #e5e6eb);
|
|
100
|
+
background: var(--ewcp-color-checkbox-disabled-bg, #f7f8fa);
|
|
80
101
|
}
|
|
81
102
|
|
|
82
103
|
.#{$prefix}checkbox--disabled .#{$prefix}checkbox__input:checked + .#{$prefix}checkbox__box {
|
|
83
|
-
border-color: #c8c9cc;
|
|
84
|
-
background: #c8c9cc;
|
|
104
|
+
border-color: var(--ewcp-color-checkbox-disabled-checked, #c8c9cc);
|
|
105
|
+
background: var(--ewcp-color-checkbox-disabled-checked, #c8c9cc);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.#{$prefix}checkbox--disabled.#{$prefix}checkbox--indeterminate .#{$prefix}checkbox__box {
|
|
109
|
+
border-color: var(--ewcp-color-checkbox-disabled-checked, #c8c9cc);
|
|
110
|
+
background: var(--ewcp-color-checkbox-disabled-checked, #c8c9cc);
|
|
85
111
|
}
|
|
86
112
|
|
|
87
113
|
.#{$prefix}checkbox--small {
|