File tree Expand file tree Collapse file tree 3 files changed +38
-24
lines changed
apps/svelte.dev/src/routes/(authed)/playground/[id]
site-kit/src/lib/styles/utils Expand file tree Collapse file tree 3 files changed +38
-24
lines changed Original file line number Diff line number Diff line change 206
206
207
207
<div class =" buttons" >
208
208
<button
209
- class =" raised icon"
209
+ class =" raised icon tooltip "
210
210
disabled ={saving || ! user }
211
211
onclick ={() => fork (false )}
212
212
aria-label ={user ? ' fork' : ' log in to fork' }
219
219
</button >
220
220
221
221
<button
222
- class =" raised icon"
222
+ class =" raised icon tooltip "
223
223
disabled ={saving || ! user }
224
224
onclick ={save }
225
225
aria-label ={user
267
267
background-size : 1.8rem ;
268
268
z-index : 999 ;
269
269
270
- &[aria-label ]:hover::before {
271
- content : ' ' ;
272
- width : 1rem ;
273
- height : 1rem ;
274
- position : absolute ;
275
- background : var (--sk-text-3 );
276
- top : calc (100% + 0.5rem );
277
- rotate : 45deg ;
278
- }
279
-
280
- &[aria-label ]:hover ::after {
281
- content : attr (aria-label );
282
- position : absolute ;
283
- top : calc (100% + 1rem );
284
- background : var (--sk-text-3 );
285
- color : var (--sk-back-4 );
286
- padding : 0.5em 0.5em ;
287
- border-radius : var (--sk-border-radius );
288
- }
289
-
290
270
&.login {
291
271
width : auto ;
292
272
background-image : url ($lib/icons/user-light.svg );
Original file line number Diff line number Diff line change 7
7
</script >
8
8
9
9
<button
10
- class =" raised"
10
+ class =" raised tooltip-left "
11
11
disabled ={! can_migrate }
12
12
onclick ={migrate }
13
- title = " Migrate this component towards the new syntax "
13
+ aria-label = " Convert syntax from Svelte 4 to 5 if possible "
14
14
>
15
15
migrate
16
16
</button >
Original file line number Diff line number Diff line change 44
44
background-position : 50% 50% ;
45
45
background-size : 2.3rem 2.3rem ;
46
46
}
47
+
48
+ button : where (.tooltip , .tooltip-left )[aria-label ]: where (: hover , : focus ) {
49
+ --arrow-size : 1rem ;
50
+
51
+ & ::before {
52
+ content : '' ;
53
+ width : var (--arrow-size );
54
+ height : var (--arrow-size );
55
+ position : absolute;
56
+ background : var (--sk-text-3 );
57
+ top : calc (100% + var (--arrow-size ) * 0.5 );
58
+ left : calc (50% - var (--arrow-size ) * 0.5 );
59
+ rotate : 45deg ;
60
+ }
61
+
62
+ & ::after {
63
+ content : attr (aria-label);
64
+ position : absolute;
65
+ top : calc (100% + var (--arrow-size ));
66
+ left : 50% ;
67
+ translate : -50% 0 ;
68
+ background : var (--sk-text-3 );
69
+ color : var (--sk-back-4 );
70
+ padding : 0.5em 0.8em ;
71
+ border-radius : var (--sk-border-radius );
72
+ font : var (--sk-font-ui-small );
73
+ text-transform : none;
74
+ white-space : pre;
75
+ }
76
+
77
+ & .tooltip-left ::after {
78
+ translate : calc (-100% + 2rem ) 0 ;
79
+ }
80
+ }
You can’t perform that action at this time.
0 commit comments