File tree Expand file tree Collapse file tree 3 files changed +67
-34
lines changed Expand file tree Collapse file tree 3 files changed +67
-34
lines changed Original file line number Diff line number Diff line change @@ -149,4 +149,56 @@ let codeMode = shallowRef('code')
149
149
pointer-events : none ;
150
150
}
151
151
}
152
+ </style >
153
+
154
+ <style >
155
+ @media only screen and (min-width : 780px ) {
156
+ .playground [data-title ] {
157
+ position : relative ;
158
+ }
159
+
160
+ .playground [data-title ]:after {
161
+ content : attr (data-title );
162
+ position : absolute ;
163
+ color : var (--vp-c-white );
164
+ background-color : rgba (0 , 0 , 0 , 0.5 );
165
+ padding : 0.25em 0.5em ;
166
+ font-size : 10px ;
167
+ width : max-content ;
168
+ opacity : 0 ;
169
+ transition : 0.2s ;
170
+ border-radius : 5px ;
171
+ pointer-events : none ;
172
+ }
173
+ .playground [data-title ]::before {
174
+ position : absolute ;
175
+ width : 0 ;
176
+ height : 0 ;
177
+ display : block ;
178
+ border : 5px solid transparent ;
179
+ content : ' ' ;
180
+ opacity : 0 ;
181
+ transition : 0.2s ;
182
+ pointer-events : none ;
183
+ }
184
+ .playground [title-left ]::before {
185
+ left : -10px ;
186
+ bottom : 50% ;
187
+ transform : translateY (50% );
188
+ border-left-color : rgba (0 , 0 , 0 , 0.5 );
189
+ }
190
+ .playground [title-left ]:after {
191
+ left : -10px ;
192
+ bottom : 50% ;
193
+ transform : translate (-100% , 50% );
194
+ }
195
+
196
+ .dark .playground [data-title ]::after {
197
+ color : var (--vp-c-brand-1 );
198
+ }
199
+
200
+ .playground [data-title ]:hover ::after , .playground [data-title ]:hover ::before {
201
+ opacity : 1 ;
202
+ }
203
+ }
152
204
</style >
Original file line number Diff line number Diff line change @@ -8,15 +8,22 @@ const lang = defineModel<string>({
8
8
required: true ,
9
9
})
10
10
11
- const version = computed (() => {
12
- return versions [lang .value ]
11
+ const versionText = computed (() => {
12
+ const ver = versions [lang .value ]
13
+ return ver ? ` Parser version ${ver } ` : ' No parser version info'
13
14
})
14
15
</script >
15
16
16
17
<template >
17
18
<div class =" selector" >
18
- <span v-if =" version" :title =" `Parser version ${version}`" >ⓘ </span >
19
- Language:
19
+ <span
20
+ class =" parser-icon"
21
+ title-left
22
+ :data-title =" versionText"
23
+ >
24
+ ⓘ
25
+ Language:
26
+ </span >
20
27
<select v-model =" lang" >
21
28
<option
22
29
class =" selector-option-text"
@@ -48,4 +55,7 @@ select {
48
55
display : none ;
49
56
}
50
57
}
58
+ .parser-icon {
59
+ cursor : help ;
60
+ }
51
61
</style >
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ async function onShare() {
22
22
23
23
<template >
24
24
<div class =" toolbars" >
25
- <button class =" floating" data-title =" Copy your code URL to share!" @click =" onShare" >
25
+ <button class =" floating" data-title =" Copy your code URL to share!" title-left @click =" onShare" >
26
26
<Share style =" width : 24px ; height : 24px ;" />
27
27
</button >
28
28
<button
@@ -65,35 +65,6 @@ async function onShare() {
65
65
color : var (--vp-c-brand );
66
66
}
67
67
68
- @media only screen and (min-width : 780px ) {
69
- [data-title ] {
70
- position : relative ;
71
- }
72
-
73
- [data-title ]:after {
74
- content : attr (data-title );
75
- position : absolute ;
76
- left : -10% ;
77
- bottom : 50% ;
78
- color : var (--vp-c-white );
79
- background-color : rgba (0 , 0 , 0 , 0.5 );
80
- padding : 0.25em 0.5em ;
81
- font-size : 10px ;
82
- width : max-content ;
83
- opacity : 0 ;
84
- transform : translate (-100% , 50% );
85
- transition : 0.2s ;
86
- border-radius : 5px ;
87
- }
88
-
89
- .dark [data-title ]:after {
90
- color : var (--vp-c-brand-1 );
91
- }
92
-
93
- [data-title ]:hover :after {
94
- opacity : 1 ;
95
- }
96
- }
97
68
.switch {
98
69
display : none ;
99
70
border-radius : 5px 5px 0px 0px ;
You can’t perform that action at this time.
0 commit comments