File tree Expand file tree Collapse file tree 3 files changed +78
-16
lines changed
apps/svelte.dev/src/routes/(authed)/playground/[id]
packages/site-kit/src/lib Expand file tree Collapse file tree 3 files changed +78
-16
lines changed Original file line number Diff line number Diff line change @@ -215,27 +215,27 @@ export default app;`
215
215
/>
216
216
217
217
<div class =" buttons" >
218
- <button class ="icon" onclick ={() => (zen_mode = ! zen_mode )} title =" fullscreen editor" >
218
+ <button class ="raised icon" onclick ={() => (zen_mode = ! zen_mode )} title =" fullscreen editor" >
219
219
{#if zen_mode }
220
220
<Icon name =" close" />
221
221
{:else }
222
222
<Icon name =" maximize" />
223
223
{/if }
224
224
</button >
225
225
226
- <button class ="icon" disabled ={downloading } onclick ={download } title =" download zip file" >
226
+ <button class ="raised icon" disabled ={downloading } onclick ={download } title =" download zip file" >
227
227
<Icon name =" download" />
228
228
</button >
229
229
230
- <button class ="icon" disabled ={saving || ! user } onclick ={() => fork (false )} title =" fork" >
230
+ <button class ="raised icon" disabled ={saving || ! user } onclick ={() => fork (false )} title =" fork" >
231
231
{#if justForked }
232
232
<Icon name =" check" />
233
233
{:else }
234
234
<Icon name =" git-branch" />
235
235
{/if }
236
236
</button >
237
237
238
- <button class ="icon" disabled ={saving || ! user } onclick ={save } title =" save" >
238
+ <button class ="raised icon" disabled ={saving || ! user } onclick ={save } title =" save" >
239
239
{#if justSaved }
240
240
<Icon name =" check" />
241
241
{:else }
@@ -249,7 +249,7 @@ export default app;`
249
249
{#if user }
250
250
<UserMenu {user } />
251
251
{:else }
252
- <button class ="icon" onclick ={(e ) => (e .preventDefault (), login ())}>
252
+ <button class ="raised icon" onclick ={(e ) => (e .preventDefault (), login ())}>
253
253
<Icon name =" log-in" />
254
254
<span > Log in to save</span >
255
255
</button >
@@ -285,7 +285,7 @@ export default app;`
285
285
.icon {
286
286
transform : translateY (0.1rem );
287
287
display : inline-block ;
288
- padding : 0.2 em ;
288
+ padding : 0.4 em ;
289
289
opacity : 0.7 ;
290
290
transition : opacity 0.3s ;
291
291
font-family : var (--sk-font-ui );
Original file line number Diff line number Diff line change 38
38
onDestroy (() => query ?.removeEventListener (' change' , cb ));
39
39
</script >
40
40
41
- <button
42
- onclick ={toggle }
43
- type =" button"
44
- aria-pressed ={$theme .current === ' dark' ? ' true' : ' false' }
45
- aria-label ={label }
46
- ></button >
41
+ <div class =" appearance" >
42
+ <span class =" caption" >Theme</span >
43
+ <button
44
+ onclick ={toggle }
45
+ class =" raised"
46
+ type =" button"
47
+ aria-pressed ={$theme .current === ' dark' ? ' true' : ' false' }
48
+ aria-label ={label }
49
+ ></button >
50
+ </div >
47
51
48
52
<style >
49
53
button {
50
- width : 2.3 rem ;
51
- height : 2.3 rem ;
54
+ width : 4 rem ;
55
+ height : 4 rem ;
52
56
background : red ;
53
- background : url ($lib/icons/theme-light.svg ) no-repeat 50% 50% / contain ;
57
+ background : url ($lib/icons/theme-light.svg ) no-repeat 50% 50% / 2.3 rem 2.3 rem ;
54
58
opacity : 0.6 ;
55
59
56
60
:global(.dark ) & {
57
- background : url ($lib/icons/theme-dark.svg );
61
+ background-image : url ($lib/icons/theme-dark.svg );
58
62
opacity : 0.8 ;
59
63
}
60
64
}
65
+
66
+ .appearance {
67
+ display : flex ;
68
+ align-items : center ;
69
+ margin-left : 1.5rem ;
70
+
71
+ .caption {
72
+ display : none ;
73
+ font-size : var (--sk-text-xs );
74
+ line-height : 1 ;
75
+ margin-right : 0rem ;
76
+ }
77
+ }
78
+
79
+ @media (max-width : 799px ) {
80
+ .appearance {
81
+ position : relative ;
82
+ display : flex ;
83
+ padding : 1.5rem 0 ;
84
+ justify-content : space-between ;
85
+ }
86
+
87
+ .appearance .caption {
88
+ display : block ;
89
+
90
+ font-size : var (--sk-text-s );
91
+ }
92
+ }
61
93
</style >
Original file line number Diff line number Diff line change @@ -171,6 +171,36 @@ button > svg {
171
171
stroke : currentColor !important ;
172
172
}
173
173
174
+ .raised {
175
+ --highlight : hsl (0 0 100 / 0.8 );
176
+ --highlight-active : hsl (0 0 100 / 1 );
177
+ --shadow : hsl (0 0 0 / 0.1 );
178
+ --shadow-active : hsl (0 0 0 / 0.15 );
179
+
180
+ .dark & {
181
+ --highlight : hsl (0 0 100 / 0.15 );
182
+ --highlight-active : hsl (0 0 100 / 0.15 );
183
+ --shadow : hsl (0 0 0 / 0.2 );
184
+ --shadow-active : hsl (0 0 0 / 0.3 );
185
+ }
186
+
187
+
188
+ border-radius : var (--sk-border-radius );
189
+ box-shadow : 2px 2px 4px var (--shadow ), -1px -1px 3px var (--highlight );
190
+
191
+ & : hover {
192
+ box-shadow : 2px 2px 5px var (--shadow-active ), -1px -1px 4px var (--highlight-active );
193
+ }
194
+
195
+ & : active {
196
+ box-shadow : inset -1px -1px 3px var (--highlight-active ), inset 1px 1px 3px var (--shadow-active );
197
+ }
198
+
199
+ & : disabled {
200
+ box-shadow : none;
201
+ }
202
+ }
203
+
174
204
/* links ------------------------------------- */
175
205
a {
176
206
color : var (--sk-theme-1 );
You can’t perform that action at this time.
0 commit comments