|
19 | 19 | --link-hover: hsl(208, 77%, 55%); |
20 | 20 | --link-active: hsl(208, 77%, 40%); |
21 | 21 | --border-radius: 4px; |
22 | | - --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; |
23 | | - --font-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace; |
| 22 | + --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, |
| 23 | + 'Open Sans', 'Helvetica Neue', sans-serif; |
| 24 | + --font-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, |
| 25 | + 'DejaVu Sans Mono', monospace; |
24 | 26 | background: var(--bg-1); |
25 | 27 | color: var(--fg-1); |
26 | 28 | font-family: var(--font); |
|
107 | 109 | opacity: 0.4; |
108 | 110 | } |
109 | 111 |
|
110 | | - input, textarea, select { |
| 112 | + input, |
| 113 | + textarea, |
| 114 | + select { |
111 | 115 | padding: 0.5rem; |
112 | 116 | border: 1px solid var(--bg-2); |
113 | 117 | border-radius: var(--border-radius); |
114 | 118 | box-sizing: border-box; |
115 | 119 | } |
116 | 120 |
|
117 | | - input, textarea { |
| 121 | + input, |
| 122 | + textarea { |
118 | 123 | background: var(--bg-1); |
119 | 124 | } |
120 | 125 |
|
|
160 | 165 | text-decoration: none; |
161 | 166 | } |
162 | 167 |
|
163 | | - nav a[aria-current="true"] { |
| 168 | + nav a[aria-current='true'] { |
164 | 169 | border-bottom: 2px solid; |
165 | 170 | } |
166 | 171 |
|
|
208 | 213 | border-radius: 5px; |
209 | 214 | user-select: none; |
210 | 215 | background: var(--bg-1); |
211 | | - filter: drop-shadow(2px 3px 6px rgba(0,0,0,0.1)); |
| 216 | + filter: drop-shadow(2px 3px 6px rgba(0, 0, 0, 0.1)); |
212 | 217 | transition: filter 0.2s, opacity 0.2s; |
213 | 218 | } |
214 | 219 |
|
|
236 | 241 | opacity: 1; |
237 | 242 | } |
238 | 243 |
|
239 | | - @media (prefers-color-scheme: dark) { |
240 | | - body { |
241 | | - --bg-1: hsl(0, 0%, 18%); |
242 | | - --bg-2: hsl(0, 0%, 30%); |
243 | | - --bg-3: hsl(0, 0%, 40%); |
244 | | - --fg-1: hsl(0, 0%, 90%); |
245 | | - --fg-2: hsl(0, 0%, 70%); |
246 | | - --fg-3: hsl(0, 0%, 60%); |
247 | | - --link: hsl(206, 96%, 72%); |
248 | | - --link-hover: hsl(206, 96%, 78%); |
249 | | - --link-active: hsl(206, 96%, 64%); |
250 | | - } |
| 244 | + body.dark { |
| 245 | + --bg-1: hsl(0, 0%, 18%); |
| 246 | + --bg-2: hsl(0, 0%, 30%); |
| 247 | + --bg-3: hsl(0, 0%, 40%); |
| 248 | + --fg-1: hsl(0, 0%, 90%); |
| 249 | + --fg-2: hsl(0, 0%, 70%); |
| 250 | + --fg-3: hsl(0, 0%, 60%); |
| 251 | + --link: hsl(206, 96%, 72%); |
| 252 | + --link-hover: hsl(206, 96%, 78%); |
| 253 | + --link-active: hsl(206, 96%, 64%); |
251 | 254 | } |
252 | 255 | </style> |
253 | 256 | </head> |
254 | 257 | <body> |
255 | 258 | <div style="display: contents">%sveltekit.body%</div> |
| 259 | + |
| 260 | + <script> |
| 261 | + const theme = new URL(window.location).searchParams.get('theme'); |
| 262 | + |
| 263 | + document.body.classList.remove('light', 'dark'); |
| 264 | + document.body.classList.add(theme || 'light'); |
| 265 | + </script> |
256 | 266 | </body> |
257 | 267 | </html> |
0 commit comments