|
7 | 7 | <div class="text">{@render children()}</div>
|
8 | 8 |
|
9 | 9 | <style>
|
10 |
| - :global { |
11 |
| - .text :where(h2) { |
| 10 | + .text :global { |
| 11 | + h2 { |
12 | 12 | margin-top: 7rem;
|
13 | 13 | }
|
14 | 14 |
|
15 |
| - .text :where(h3) { |
| 15 | + h3 { |
16 | 16 | margin-top: 5rem;
|
17 | 17 | }
|
18 | 18 |
|
19 |
| - .text :where(p, ol, ul) { |
| 19 | + p, |
| 20 | + ol, |
| 21 | + ul { |
20 | 22 | margin: 1em 0;
|
21 | 23 | font-size: var(--sk-text-s);
|
22 | 24 | }
|
23 | 25 |
|
24 |
| - .text :where(section) { |
| 26 | + /* TODO is this still used? don't think so */ |
| 27 | + section { |
25 | 28 | max-width: var(--sk-line-max-width);
|
26 | 29 | padding: 0 0 0 1rem;
|
27 |
| - } |
28 | 30 |
|
29 |
| - .text :where(section) :where(h2, h3, h4) { |
30 |
| - margin-left: -1rem; |
| 31 | + h2, |
| 32 | + h3, |
| 33 | + h4 { |
| 34 | + margin-left: -1rem; |
| 35 | + } |
| 36 | +
|
| 37 | + a code { |
| 38 | + color: inherit; |
| 39 | + } |
31 | 40 | }
|
32 | 41 |
|
33 |
| - /* code */ |
34 |
| - .text :where(code) { |
| 42 | + code { |
35 | 43 | white-space: pre-wrap;
|
36 | 44 | padding: 0.2rem 0.4rem;
|
37 | 45 | margin: 0 0.2rem;
|
38 | 46 | top: -0.1rem;
|
39 | 47 | background: var(--sk-back-4);
|
40 | 48 | }
|
41 | 49 |
|
42 |
| - .text :where(.code-block) { |
| 50 | + .code-block { |
43 | 51 | position: relative;
|
44 |
| - } |
45 | 52 |
|
46 |
| - .text :where(.copy-code-block) { |
47 |
| - box-shadow: 1px 2px 1rem hsla(0 0 0 / 0.08); |
| 53 | + .filename { |
| 54 | + content: attr(data-file); |
| 55 | + display: block; |
| 56 | + width: 100%; |
| 57 | + font-family: var(--sk-font-mono); |
| 58 | + font-size: 1.2rem; |
| 59 | + font-weight: 400; |
| 60 | + padding: 1rem 1rem 0.8rem 1rem; |
| 61 | + color: var(--sk-text-2); |
| 62 | + background: var(--sk-back-4); |
| 63 | + border-radius: var(--sk-border-radius) var(--sk-border-radius) 0 0; |
| 64 | + box-sizing: border-box; |
| 65 | + } |
| 66 | +
|
| 67 | + pre { |
| 68 | + margin-top: 0; |
| 69 | + border-radius: 0 0 var(--sk-border-radius) var(--sk-border-radius); |
| 70 | + } |
48 | 71 | }
|
49 | 72 |
|
50 |
| - .text :where(pre) { |
| 73 | + pre { |
51 | 74 | position: relative;
|
52 | 75 | margin: 1em 0;
|
53 | 76 | width: 100%;
|
54 | 77 | padding: 1rem;
|
55 |
| -
|
56 |
| - /* box-shadow: inset 1px 1px 6px hsla(205.7, 63.6%, 30.8%, 0.06); */ |
57 | 78 | box-sizing: border-box;
|
58 |
| - /* background-color: var(--sk-code-bg); */ |
59 | 79 | color: var(--sk-code-base);
|
60 | 80 | border-radius: var(--sk-border-radius);
|
61 | 81 | font-size: var(--sk-text-s);
|
62 | 82 | overflow-x: auto;
|
63 |
| - } |
64 | 83 |
|
65 |
| - .text :where(pre code) { |
66 |
| - display: block; |
67 |
| - padding: 0; |
68 |
| - margin: 0; |
69 |
| - top: 0; |
70 |
| - width: 100%; |
71 |
| - background: transparent; |
| 84 | + code { |
| 85 | + display: block; |
| 86 | + padding: 0; |
| 87 | + margin: 0; |
| 88 | + top: 0; |
| 89 | + width: 100%; |
| 90 | + background: transparent; |
| 91 | + } |
| 92 | +
|
| 93 | + a:hover { |
| 94 | + border-bottom: 1px solid var(--sk-theme-1); |
| 95 | + text-decoration: none; |
| 96 | + } |
| 97 | +
|
| 98 | + /* TODO what is this for? */ |
| 99 | + &.border { |
| 100 | + border-left: 5px solid var(--sk-theme-2); |
| 101 | + } |
| 102 | +
|
| 103 | + &.language-diff code { |
| 104 | + color: var(--sk-code-diff-base); |
| 105 | + } |
72 | 106 | }
|
73 | 107 |
|
74 |
| - .text :where(p code) { |
| 108 | + p code { |
75 | 109 | max-width: 100%;
|
76 | 110 | display: inline-flex;
|
77 | 111 | overflow-x: auto;
|
78 | 112 | padding-top: 0;
|
79 | 113 | padding-bottom: 0;
|
80 | 114 | }
|
81 | 115 |
|
82 |
| - .text :where(.code-block .filename) { |
83 |
| - content: attr(data-file); |
84 |
| - display: block; |
85 |
| - width: 100%; |
86 |
| - font-family: var(--sk-font-mono); |
87 |
| - font-size: 1.2rem; |
88 |
| - font-weight: 400; |
89 |
| - padding: 1rem 1rem 0.8rem 1rem; |
90 |
| - color: var(--sk-text-2); |
91 |
| - background: var(--sk-back-4); |
92 |
| - border-radius: var(--sk-border-radius) var(--sk-border-radius) 0 0; |
93 |
| - box-sizing: border-box; |
94 |
| - } |
95 |
| -
|
96 |
| - .text :where(.code-block pre) { |
97 |
| - margin-top: 0; |
98 |
| - border-radius: 0 0 var(--sk-border-radius) var(--sk-border-radius); |
| 116 | + /* TODO what is this for? */ |
| 117 | + .copy-code-block { |
| 118 | + box-shadow: 1px 2px 1rem hsla(0 0 0 / 0.08); |
99 | 119 | }
|
100 | 120 |
|
101 |
| - .text :where(a:not(.permalink)) { |
| 121 | + a:not(.permalink) { |
102 | 122 | color: inherit;
|
103 | 123 | text-decoration: underline;
|
104 | 124 | transition: box-shadow 0.1s ease-in-out;
|
105 |
| - } |
106 |
| -
|
107 |
| - .text :where(a:not(.permalink) code) { |
108 |
| - all: unset !important; |
109 |
| - color: inherit; |
110 |
| - background-color: transparent !important; |
111 |
| - } |
112 | 125 |
|
113 |
| - .text :where(pre a):hover { |
114 |
| - border-bottom: 1px solid var(--sk-theme-1); |
115 |
| - text-decoration: none; |
116 |
| - } |
117 |
| -
|
118 |
| - .text :where(pre.border) { |
119 |
| - border-left: 5px solid var(--sk-theme-2); |
120 |
| - } |
121 |
| -
|
122 |
| - .text :where(pre.language-diff code) { |
123 |
| - color: var(--sk-code-diff-base); |
| 126 | + /* TODO what is this for? */ |
| 127 | + code { |
| 128 | + all: unset !important; |
| 129 | + color: inherit; |
| 130 | + background-color: transparent !important; |
| 131 | + } |
124 | 132 | }
|
125 | 133 |
|
126 | 134 | /* permalinks */
|
127 |
| - .text :where([id]) { |
| 135 | + [id] { |
128 | 136 | scroll-margin-top: calc(var(--sk-nav-height) + 4rem);
|
129 | 137 | }
|
130 | 138 |
|
131 |
| - .text :where(a.permalink) { |
| 139 | + a.permalink { |
132 | 140 | position: absolute !important;
|
133 | 141 | display: block;
|
134 | 142 | background: url(../icons/link.svg) 0 50% no-repeat;
|
|
153 | 161 | }
|
154 | 162 | }
|
155 | 163 |
|
156 |
| - @media (max-width: 768px) { |
157 |
| - .text :where(blockquote *) { |
158 |
| - word-break: break-word; |
159 |
| - } |
160 |
| - } |
161 |
| -
|
162 |
| - /* lists */ |
163 |
| - .text :where(ol, ul) { |
| 164 | + ol, |
| 165 | + ul { |
164 | 166 | --list-padding: 3rem;
|
165 | 167 | margin-left: var(--list-padding);
|
166 | 168 | }
|
167 | 169 |
|
168 |
| - .text :where(ul) { |
| 170 | + ul { |
169 | 171 | list-style: none;
|
| 172 | +
|
| 173 | + li::before { |
| 174 | + content: ''; |
| 175 | + position: absolute; |
| 176 | + margin-top: 0.8rem; |
| 177 | + margin-left: -1.8rem; |
| 178 | + background-color: var(--sk-back-5); |
| 179 | + width: 0.6rem; |
| 180 | + height: 0.6rem; |
| 181 | + border-radius: 2px; |
| 182 | + opacity: 0.7; |
| 183 | + } |
| 184 | +
|
| 185 | + ul { |
| 186 | + margin-bottom: 0; |
| 187 | + } |
170 | 188 | }
|
171 | 189 |
|
172 |
| - .text :where(ol) { |
| 190 | + ol { |
173 | 191 | list-style: decimal;
|
174 | 192 | }
|
175 | 193 |
|
176 |
| - .text :where(li) { |
| 194 | + li { |
177 | 195 | position: relative;
|
178 | 196 | max-width: calc(var(--sk-line-max-width) - var(--list-padding));
|
179 | 197 | line-height: 1.5;
|
180 | 198 | margin: 0 0 0.5em 0;
|
181 | 199 | }
|
182 | 200 |
|
183 |
| - .text :where(ul li)::before { |
184 |
| - content: ''; |
185 |
| - position: absolute; |
186 |
| - margin-top: 0.8rem; |
187 |
| - margin-left: -1.8rem; |
188 |
| - background-color: var(--sk-back-5); |
189 |
| - width: 0.6rem; |
190 |
| - height: 0.6rem; |
191 |
| - border-radius: 2px; |
192 |
| - opacity: 0.7; |
193 |
| - } |
194 |
| -
|
195 |
| - .text :where(table) { |
| 201 | + table { |
196 | 202 | margin: 1em 0;
|
197 | 203 | }
|
198 | 204 |
|
199 |
| - .text :where(small) { |
| 205 | + small { |
200 | 206 | font-size: var(--sk-text-s);
|
201 | 207 | float: right;
|
202 | 208 | pointer-events: all;
|
203 | 209 | color: var(--sk-theme-1);
|
204 | 210 | cursor: pointer;
|
205 | 211 | }
|
206 | 212 |
|
207 |
| - .text :where(blockquote) { |
| 213 | + blockquote { |
208 | 214 | --primary-hsl: var(--sk-theme-1-hsl);
|
209 | 215 | color: var(--sk-text-1);
|
210 | 216 | padding: 0 0 0 4.5rem;
|
211 | 217 | font-style: italic;
|
212 | 218 |
|
213 |
| - em, |
214 |
| - i { |
215 |
| - font-style: normal; |
| 219 | + &:first-child { |
| 220 | + margin-top: 0; |
216 | 221 | }
|
217 | 222 |
|
218 |
| - code { |
219 |
| - font-style: normal; |
| 223 | + &:last-child { |
| 224 | + margin-bottom: 0; |
220 | 225 | }
|
221 |
| - } |
222 |
| -
|
223 |
| - .text :where(blockquote)::before { |
224 |
| - content: ''; |
225 |
| - display: block; |
226 |
| - width: 3rem; |
227 |
| - height: 3rem; |
228 |
| - position: absolute; |
229 |
| - left: 0.5rem; |
230 |
| - top: 0; |
231 |
| - background: url($lib/icons/lightbulb.svg) no-repeat 50% 50% / contain; |
232 |
| - } |
233 | 226 |
|
234 |
| - .text :where(blockquote):first-child { |
235 |
| - margin-top: 0; |
236 |
| - } |
| 227 | + &::before { |
| 228 | + content: ''; |
| 229 | + display: block; |
| 230 | + width: 3rem; |
| 231 | + height: 3rem; |
| 232 | + position: absolute; |
| 233 | + left: 0.5rem; |
| 234 | + top: 0; |
| 235 | + background: url($lib/icons/lightbulb.svg) no-repeat 50% 50% / contain; |
| 236 | + } |
237 | 237 |
|
238 |
| - .text :where(blockquote):last-child { |
239 |
| - margin-bottom: 0; |
240 |
| - } |
| 238 | + &.deprecated { |
| 239 | + --primary-hsl: var(--sk-text-warning-hsl); |
| 240 | + --color: var(--primary-hsl); |
241 | 241 |
|
242 |
| - .text :where(blockquote.deprecated) { |
243 |
| - --primary-hsl: var(--sk-text-warning-hsl); |
244 |
| - --color: var(--primary-hsl); |
245 |
| - } |
| 242 | + &::before { |
| 243 | + content: 'Deprecated'; |
| 244 | + } |
246 | 245 |
|
247 |
| - .text :where(blockquote.deprecated)::before { |
248 |
| - content: 'Deprecated'; |
249 |
| - } |
| 246 | + a { |
| 247 | + --color: var(--primary-hsl); |
| 248 | + } |
| 249 | + } |
250 | 250 |
|
251 |
| - .text :where(blockquote.deprecated a) { |
252 |
| - --color: var(--primary-hsl); |
253 |
| - } |
| 251 | + em, |
| 252 | + i { |
| 253 | + font-style: normal; |
| 254 | + } |
254 | 255 |
|
255 |
| - .text :where(section a code) { |
256 |
| - color: inherit; |
257 |
| - } |
| 256 | + code { |
| 257 | + font-style: normal; |
| 258 | + } |
258 | 259 |
|
259 |
| - .text :where(ul ul) { |
260 |
| - margin-bottom: 0; |
| 260 | + @media (max-width: 767px) { |
| 261 | + * { |
| 262 | + word-break: break-word; |
| 263 | + } |
| 264 | + } |
261 | 265 | }
|
262 | 266 |
|
263 | 267 | details.legacy {
|
|
0 commit comments