Skip to content

Commit 9039ae6

Browse files
committed
release(toolbar): v0.9.2
1 parent b060590 commit 9039ae6

File tree

5 files changed

+249
-237
lines changed

5 files changed

+249
-237
lines changed

index.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@
399399
},
400400
"toolbar": {
401401
"react": true,
402-
"version": "0.9.1",
402+
"version": "0.9.2",
403403
"style": true,
404404
"icon": false,
405405
"test": true,

src/setting/style.scss

+77-73
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
@use '../share/mixin' as mixin;
2-
@use '../share/theme' as theme;
1+
@use '../share/mixin' as *;
2+
@use '../share/theme' as *;
33

44
.luna-setting {
55
min-width: 320px;
6-
@include mixin.component();
6+
@include component(true);
77
}
88

99
.item {
10-
&:hover,
11-
&.selected {
12-
background: theme.$color-fill-secondary;
13-
}
1410
&.selected:focus {
15-
outline: 1px solid theme.$color-primary;
11+
outline: 1px solid;
1612
}
1713
.title {
1814
line-height: 1.4em;
@@ -29,13 +25,12 @@
2925
}
3026
a {
3127
background-color: transparent;
32-
color: #0969da;
3328
text-decoration: none;
3429
}
3530
}
3631
.description,
3732
.control {
38-
font-size: #{theme.$font-size-s-m}px;
33+
font-size: #{$font-size-s-m}px;
3934
}
4035
.description {
4136
margin-bottom: 8px;
@@ -76,7 +71,7 @@
7671
}
7772
}
7873
input {
79-
@include mixin.input();
74+
@include input();
8075
width: 100%;
8176
}
8277
}
@@ -92,7 +87,7 @@
9287
}
9388
}
9489
input[type='number'] {
95-
@include mixin.input();
90+
@include input();
9691
width: 200px;
9792
padding: 2px;
9893
}
@@ -108,14 +103,12 @@
108103
left: 0;
109104
top: 4px;
110105
.range-track-bar {
111-
background: theme.$color-border;
112106
border-radius: 2px;
113107
overflow: hidden;
114108
width: 100%;
115109
height: 4px;
116110
.range-track-progress {
117111
height: 100%;
118-
background: theme.$color-primary;
119112
width: 50%;
120113
}
121114
}
@@ -140,14 +133,7 @@
140133
border: none;
141134
height: 16px;
142135
border-radius: 10px;
143-
border: 1px solid theme.$color-border;
144-
background: radial-gradient(
145-
circle at center,
146-
#eee 0,
147-
#eee 15%,
148-
#fff 22%,
149-
#fff 100%
150-
);
136+
border: 1px solid;
151137
}
152138
}
153139
}
@@ -159,7 +145,7 @@
159145
}
160146
}
161147
input {
162-
@include mixin.checkbox();
148+
@include checkbox();
163149
align-self: flex-start;
164150
flex-shrink: 0;
165151
}
@@ -178,7 +164,7 @@
178164
}
179165
}
180166
.select {
181-
@include mixin.select();
167+
@include select();
182168
select {
183169
width: 300px;
184170
}
@@ -187,69 +173,87 @@
187173

188174
.item-button {
189175
button {
190-
@include mixin.button();
176+
@include button();
191177
}
192178
}
193179

194180
.item-separator {
195-
border-bottom: 1px solid theme.$color-border;
181+
border-bottom: 1px solid;
196182
}
197183

198-
.theme-dark {
199-
.item {
200-
&:hover,
201-
&.selected {
202-
background: theme.$color-fill-secondary-dark;
203-
}
204-
.description {
205-
a {
206-
background-color: transparent;
207-
color: #58a6ff;
184+
@each $theme in ('light', 'dark') {
185+
.theme-#{$theme} {
186+
.item {
187+
&:hover,
188+
&.selected {
189+
@include theme-var(background-color, color-fill-secondary, $theme);
190+
}
191+
&.selected:focus {
192+
@include theme-var(outline-color, color-primary, $theme);
193+
}
194+
.description,
195+
&.item-markdown {
196+
a {
197+
@include theme-var(color, color-primary, $theme);
198+
}
208199
}
209200
}
210-
}
211-
.item-separator {
212-
border-color: theme.$color-border-dark;
213-
}
214-
.item-input {
215-
input {
216-
@include mixin.input(true);
201+
.item-separator {
202+
@include theme-var(border-color, color-border, $theme);
217203
}
218-
}
219-
.item-checkbox {
220-
input {
221-
@include mixin.checkbox(true);
204+
.item-input {
205+
input {
206+
@include input-theme($theme);
207+
}
222208
}
223-
}
224-
.item-select {
225-
.select {
226-
@include mixin.select(true);
209+
.item-checkbox {
210+
input {
211+
@include checkbox-theme($theme);
212+
}
227213
}
228-
}
229-
.item-button {
230-
button {
231-
@include mixin.button(true);
214+
.item-select {
215+
.select {
216+
@include select-theme($theme);
217+
}
232218
}
233-
}
234-
.item-number {
235-
input[type='number'] {
236-
@include mixin.input(true);
219+
.item-button {
220+
button {
221+
@include button-theme($theme);
222+
}
237223
}
238-
.range-container {
239-
.range-track {
240-
.range-track-bar {
241-
background: theme.$color-border-dark;
242-
}
224+
.item-number {
225+
input[type='number'] {
226+
@include input-theme($theme);
243227
}
244-
input::-webkit-slider-thumb {
245-
border-color: theme.$color-border-dark;
246-
background: radial-gradient(
247-
circle at center,
248-
#aaa 0,
249-
#aaa 15%,
250-
#ccc 22%,
251-
#ccc 100%
252-
);
228+
.range-container {
229+
.range-track {
230+
.range-track-bar {
231+
@include theme-var(background-color, color-border, $theme);
232+
.range-track-progress {
233+
@include theme-var(background-color, color-primary, $theme);
234+
}
235+
}
236+
}
237+
input::-webkit-slider-thumb {
238+
@include theme-var(border-color, color-border, $theme);
239+
@if ($theme == 'light') {
240+
background: radial-gradient(
241+
circle at center,
242+
#eee 0,
243+
#eee 15%,
244+
#fff 22%,
245+
#fff 100%
246+
);
247+
} @else {
248+
background: radial-gradient(
249+
circle at center,
250+
#aaa 0,
251+
#aaa 15%,
252+
#ccc 22%,
253+
#ccc 100%
254+
);
255+
}
256+
}
253257
}
254258
}
255259
}

0 commit comments

Comments
 (0)