|
8 | 8 |
|
9 | 9 | html.dark .astro-code-themes { |
10 | 10 | color: var(--shiki-dark) !important; |
11 | | - background-color: var(--shiki-dark-bg) !important; |
| 11 | + background-color: transparent !important; |
12 | 12 | } |
13 | 13 |
|
14 | 14 | html.dark .astro-code-themes span { |
@@ -61,14 +61,33 @@ pre.twoslash:hover .twoslash-hover { |
61 | 61 | position: absolute; |
62 | 62 | transform: translate(0, 1rem); |
63 | 63 | z-index: 100; |
| 64 | + width: max-content; |
| 65 | + max-width: 80vw; |
64 | 66 |
|
65 | | - @apply bg-white text-gray-900 border border-gray-200 shadow-sm px-3 p-2 rounded-sm |
66 | | - dark:bg-black dark:text-gray-50 dark:border-gray-700 dark:shadow-md; |
| 67 | + @apply rounded-sm border border-gray-200 bg-white p-2 px-3 text-gray-900 shadow-sm dark:border-gray-700 dark:bg-black dark:text-gray-50 dark:shadow-md; |
67 | 68 |
|
68 | 69 | text-align: left; |
69 | 70 | white-space: pre-wrap; |
70 | 71 | } |
71 | 72 |
|
| 73 | +@supports (anchor-name: --x) { |
| 74 | + .twoslash-hover:hover { |
| 75 | + anchor-name: --twoslash-hover; |
| 76 | + } |
| 77 | + |
| 78 | + .twoslash-popup-container { |
| 79 | + position: fixed; |
| 80 | + transform: none; |
| 81 | + position-anchor: --twoslash-hover; |
| 82 | + position-area: bottom; |
| 83 | + position-try-fallbacks: --above; |
| 84 | + } |
| 85 | + |
| 86 | + @position-try --above { |
| 87 | + position-area: top; |
| 88 | + } |
| 89 | +} |
| 90 | + |
72 | 91 | .twoslash-hover:hover > .twoslash-popup-container { |
73 | 92 | display: block; |
74 | 93 | } |
@@ -102,150 +121,10 @@ pre .twoslash-error-line { |
102 | 121 | @apply bg-gray-100 dark:bg-gray-800 dark:text-white; |
103 | 122 | } |
104 | 123 |
|
105 | | -/* --- Code container --- */ |
106 | | - |
107 | | -pre .code-container { |
108 | | - overflow: auto; |
109 | | -} |
110 | | - |
111 | 124 | pre code { |
112 | 125 | white-space: pre; |
113 | 126 | -webkit-overflow-scrolling: touch; |
114 | 127 | } |
115 | 128 | pre code a { |
116 | 129 | text-decoration: none; |
117 | 130 | } |
118 | | - |
119 | | -/* --- Query/Error blocks --- */ |
120 | | - |
121 | | -pre .query { |
122 | | - margin-bottom: 10px; |
123 | | - color: #137998; |
124 | | - display: inline-block; |
125 | | -} |
126 | | - |
127 | | -pre .error, |
128 | | -pre .error-behind { |
129 | | - margin-top: 0.5em; |
130 | | - padding: 0.5em 1em; |
131 | | - width: var(--container-width); |
132 | | - white-space: pre-wrap; |
133 | | - display: block; |
134 | | -} |
135 | | -pre .error { |
136 | | - @apply bg-gray-100 dark:bg-gray-800 dark:text-white; |
137 | | - position: absolute; |
138 | | - border-left: 2px solid #bf1818; |
139 | | - display: flex; |
140 | | - align-items: center; |
141 | | -} |
142 | | -pre .error .code { |
143 | | - display: none; |
144 | | -} |
145 | | -pre .error-behind { |
146 | | - user-select: none; |
147 | | - visibility: transparent; |
148 | | - color: #fee; |
149 | | -} |
150 | | - |
151 | | -/* --- Annotations --- */ |
152 | | - |
153 | | -.tag-container { |
154 | | - position: relative; |
155 | | -} |
156 | | -.tag-container .twoslash-annotation { |
157 | | - position: absolute; |
158 | | - font-family: "JetBrains Mono", Menlo, Monaco, Consolas, Courier New, monospace; |
159 | | - right: -10px; |
160 | | - width: 200px; |
161 | | - color: #187abf; |
162 | | - background-color: #fcf3d9bb; |
163 | | -} |
164 | | -.tag-container .twoslash-annotation p { |
165 | | - text-align: left; |
166 | | - font-size: 0.8rem; |
167 | | - line-height: 0.9rem; |
168 | | -} |
169 | | -.tag-container .twoslash-annotation svg { |
170 | | - float: left; |
171 | | - margin-left: -44px; |
172 | | -} |
173 | | -.tag-container .twoslash-annotation.left { |
174 | | - right: auto; |
175 | | - left: -200px; |
176 | | -} |
177 | | -.tag-container .twoslash-annotation.left svg { |
178 | | - float: right; |
179 | | - margin-right: -5px; |
180 | | -} |
181 | | - |
182 | | -/* --- Console log/warn/error --- */ |
183 | | - |
184 | | -pre .logger { |
185 | | - display: flex; |
186 | | - align-items: center; |
187 | | - color: black; |
188 | | - padding: 6px; |
189 | | - padding-left: 8px; |
190 | | - width: calc(100% - 19px); |
191 | | - white-space: pre-wrap; |
192 | | -} |
193 | | -pre .logger svg { |
194 | | - margin-right: 9px; |
195 | | -} |
196 | | -pre .logger.error-log { |
197 | | - background-color: #fee; |
198 | | - border-left: 2px solid #bf1818; |
199 | | -} |
200 | | -pre .logger.warn-log { |
201 | | - background-color: #ffe; |
202 | | - border-left: 2px solid #eae662; |
203 | | -} |
204 | | -pre .logger.log-log { |
205 | | - background-color: #e9e9e9; |
206 | | - border-left: 2px solid #ababab; |
207 | | -} |
208 | | -pre .logger.log-log svg { |
209 | | - margin-left: 6px; |
210 | | - margin-right: 9px; |
211 | | -} |
212 | | - |
213 | | -/* --- Completions --- */ |
214 | | - |
215 | | -pre .inline-completions ul.dropdown { |
216 | | - display: inline-block; |
217 | | - position: absolute; |
218 | | - width: 240px; |
219 | | - background-color: gainsboro; |
220 | | - color: grey; |
221 | | - padding-top: 4px; |
222 | | - font-family: var(--code-font); |
223 | | - font-size: 0.8rem; |
224 | | - margin: 0; |
225 | | - padding: 0; |
226 | | - border-left: 4px solid #4b9edd; |
227 | | -} |
228 | | -pre .inline-completions ul.dropdown::before { |
229 | | - background-color: #4b9edd; |
230 | | - width: 2px; |
231 | | - position: absolute; |
232 | | - top: -1.2rem; |
233 | | - left: -3px; |
234 | | - content: " "; |
235 | | -} |
236 | | -pre .inline-completions ul.dropdown li { |
237 | | - overflow-x: hidden; |
238 | | - padding-left: 4px; |
239 | | - margin-bottom: 4px; |
240 | | -} |
241 | | -pre .inline-completions ul.dropdown li.deprecated { |
242 | | - text-decoration: line-through; |
243 | | -} |
244 | | -pre .inline-completions ul.dropdown li span.result-found { |
245 | | - color: #4b9edd; |
246 | | -} |
247 | | -pre .inline-completions ul.dropdown li span.result { |
248 | | - width: 100px; |
249 | | - color: black; |
250 | | - display: inline-block; |
251 | | -} |
0 commit comments