| 1 |
|
| 2 |
@font-face { |
| 3 |
/* ubuntu-regular - latin */ |
| 4 |
font-family: 'Ubuntu'; |
| 5 |
src: local(''), url('/static/fonts/ubuntu-v15-latin-regular.woff2') format('woff2'), url('/static/fonts/ubuntu-v15-latin-regular.woff') format('woff'), url('/static/fonts/ubuntu-v15-latin-regular.ttf') format('truetype'); |
| 6 |
font-style: normal; |
| 7 |
font-weight: 400; |
| 8 |
font-display: swap; |
| 9 |
} |
| 10 |
|
| 11 |
:root { |
| 12 |
--header-height: 4rem; |
| 13 |
--content-inline-padding: 1.3rem; |
| 14 |
--content-max-width: 80ch; |
| 15 |
/* define our palette for all themes */ |
| 16 |
--white: #fff; |
| 17 |
--gray-100: #f3f4f6; |
| 18 |
--gray-200: #e5e7eb; |
| 19 |
--gray-300: #d1d5db; |
| 20 |
--gray-400: #9ca3af; |
| 21 |
--gray-800: #1f2937; |
| 22 |
--gray-900: #111827; |
| 23 |
--brand-purple: #5555ff; |
| 24 |
--brand-pink: #ff55dd; |
| 25 |
/* light-theme vars */ |
| 26 |
--c-bg: var(--gray-100); |
| 27 |
--c-bg-secondary: var(--white); |
| 28 |
--c-text: var(--gray-800); |
| 29 |
--c-border: var(--gray-300); |
| 30 |
--c-hl: var(--brand-pink); |
| 31 |
--c-hl-secondary: var(--brand-purple); |
| 32 |
--c-text-on-hl: var(--gray-800); |
| 33 |
--c-text-on-hl-secondary: var(--white); |
| 34 |
} |
| 35 |
|
| 36 |
@media (prefers-color-scheme: dark) { |
| 37 |
:root { |
| 38 |
--c-bg: var(--gray-800); |
| 39 |
--c-bg-secondary: var(--gray-900); |
| 40 |
--c-text: var(--gray-200); |
| 41 |
--c-border: var(--gray-400); |
| 42 |
} |
| 43 |
} |
| 44 |
|
| 45 |
* { |
| 46 |
color: var(--c-text); |
| 47 |
box-sizing: border-box; |
| 48 |
font-family: Ubuntu, sans-serif; |
| 49 |
letter-spacing: .1ch; |
| 50 |
} |
| 51 |
|
| 52 |
main *, .hero * { |
| 53 |
line-height: 1.5; |
| 54 |
} |
| 55 |
|
| 56 |
body { |
| 57 |
background-color: var(--c-bg); |
| 58 |
min-height: 100vh; |
| 59 |
display: grid; |
| 60 |
grid-template-rows: var(--header-height) min-content auto auto min-content; |
| 61 |
grid-template-columns: 1fr; |
| 62 |
grid-template-areas: "header" "hero" "main" "aside" "footer"; |
| 63 |
} |
| 64 |
|
| 65 |
a { |
| 66 |
text-decoration: underline; |
| 67 |
text-underline-offset: .05rem; |
| 68 |
} |
| 69 |
|
| 70 |
a:hover { |
| 71 |
text-underline-offset: .25rem; |
| 72 |
color: var(--c-hl); |
| 73 |
} |
| 74 |
|
| 75 |
h1, h2, h3, h4, h5, h6, p { |
| 76 |
word-break: break-word; |
| 77 |
scroll-margin-block-start: 4.5rem; |
| 78 |
} |
| 79 |
|
| 80 |
h1, h2, h3, h4, h5, h6, strong { |
| 81 |
font-weight: 500; |
| 82 |
} |
| 83 |
|
| 84 |
em { |
| 85 |
font-style: italic; |
| 86 |
} |
| 87 |
|
| 88 |
h2, h3, h4, h5, h6 { |
| 89 |
margin-block-end: 0; |
| 90 |
} |
| 91 |
|
| 92 |
h1+*, h2+*, h3+*, h4+*, h5+*, h6+* { |
| 93 |
margin-block-start: 0; |
| 94 |
} |
| 95 |
|
| 96 |
main h1 { |
| 97 |
font-size: 2.25rem; |
| 98 |
} |
| 99 |
|
| 100 |
main h2 { |
| 101 |
font-size: 1.5rem; |
| 102 |
} |
| 103 |
|
| 104 |
main h3 { |
| 105 |
font-size: 1.25rem; |
| 106 |
} |
| 107 |
|
| 108 |
main :is(h2, h3, h4, h5, h6) a { |
| 109 |
text-decoration: none; |
| 110 |
position: relative; |
| 111 |
} |
| 112 |
|
| 113 |
main :is(h2, h3, h4, h5, h6) a:hover::before { |
| 114 |
content: '#'; |
| 115 |
position: absolute; |
| 116 |
left: -1.5ch; |
| 117 |
bottom: 0; |
| 118 |
font-weight: normal; |
| 119 |
font-size: 1rem; |
| 120 |
} |
| 121 |
|
| 122 |
@media screen and (min-width: 800px) { |
| 123 |
body { |
| 124 |
grid-template-columns: min-content 8fr; |
| 125 |
grid-template-rows: 4rem min-content auto min-content; |
| 126 |
grid-template-areas: "header header" "hero hero" "aside main" "footer footer"; |
| 127 |
} |
| 128 |
} |
| 129 |
|
| 130 |
.skiplink { |
| 131 |
z-index: 9999; |
| 132 |
transform: translateY(calc(-100% - 1rem)); |
| 133 |
display: block; |
| 134 |
position: absolute; |
| 135 |
height: 4rem; |
| 136 |
padding: var(--content-inline-padding); |
| 137 |
background-color: var(--c-bg); |
| 138 |
border-inline-end: 1px solid var(--c-border); |
| 139 |
border-block-end: 1px solid var(--c-border); |
| 140 |
} |
| 141 |
|
| 142 |
.skiplink:focus { |
| 143 |
z-index: 9999; |
| 144 |
transform: translateY(0); |
| 145 |
} |
| 146 |
|
| 147 |
header { |
| 148 |
grid-area: header; |
| 149 |
height: var(--header-height); |
| 150 |
border-block-end: 1px solid var(--c-border); |
| 151 |
background-color: var(--c-bg-secondary); |
| 152 |
position: sticky; |
| 153 |
top: 0; |
| 154 |
z-index: 1000; |
| 155 |
display: flex; |
| 156 |
flex-direction: row; |
| 157 |
flex-wrap: nowrap; |
| 158 |
justify-content: space-between; |
| 159 |
} |
| 160 |
|
| 161 |
header a { |
| 162 |
text-decoration: none; |
| 163 |
} |
| 164 |
|
| 165 |
header .logo { |
| 166 |
display: flex; |
| 167 |
flex-wrap: nowrap; |
| 168 |
align-items: center; |
| 169 |
height: 100%; |
| 170 |
padding-inline-start: var(--content-inline-padding); |
| 171 |
} |
| 172 |
|
| 173 |
header .logo img { |
| 174 |
padding-block-end: .3rem; |
| 175 |
} |
| 176 |
|
| 177 |
header .logo h1 { |
| 178 |
margin: 0; |
| 179 |
margin-bottom: -.4rem; |
| 180 |
font-size: 1.7rem; |
| 181 |
line-height: 1; |
| 182 |
font-family: Comfortaa, Ubuntu, sans-serif; |
| 183 |
font-weight: bold; |
| 184 |
} |
| 185 |
|
| 186 |
header .nav-toggle { |
| 187 |
display: block; |
| 188 |
border-inline-start: 1px solid var(--c-border); |
| 189 |
padding: 0 1rem; |
| 190 |
display: flex; |
| 191 |
align-items: center; |
| 192 |
cursor: pointer; |
| 193 |
} |
| 194 |
|
| 195 |
header nav details summary, header nav a { |
| 196 |
border-block-end: 1px solid var(--c-border); |
| 197 |
padding: 1rem; |
| 198 |
display: flex; |
| 199 |
align-items: center; |
| 200 |
cursor: pointer; |
| 201 |
white-space: nowrap; |
| 202 |
} |
| 203 |
|
| 204 |
header nav details summary::before { |
| 205 |
content: "►"; |
| 206 |
padding-inline-end: .3rem; |
| 207 |
} |
| 208 |
|
| 209 |
header nav details[open] summary::before { |
| 210 |
content: "▼"; |
| 211 |
} |
| 212 |
|
| 213 |
header nav .nav-close { |
| 214 |
display: none; |
| 215 |
} |
| 216 |
|
| 217 |
header nav.show .nav-close { |
| 218 |
display: flex; |
| 219 |
} |
| 220 |
|
| 221 |
header nav { |
| 222 |
transform: translateY(calc(-100% - 1rem)); |
| 223 |
display: flex; |
| 224 |
flex-direction: column; |
| 225 |
justify-content: flex-start; |
| 226 |
position: fixed; |
| 227 |
right: 0; |
| 228 |
top: 0; |
| 229 |
bottom: 0; |
| 230 |
background-color: var(--c-bg-secondary); |
| 231 |
min-width: 20rem; |
| 232 |
max-width: 30rem; |
| 233 |
border-inline-start: 1px solid var(--c-border); |
| 234 |
z-index: 10000; |
| 235 |
} |
| 236 |
|
| 237 |
header nav.show, header nav:focus-within { |
| 238 |
transform: translateY(0); |
| 239 |
} |
| 240 |
|
| 241 |
header nav details summary.highlight, header nav a.highlight { |
| 242 |
background-color: var(--c-hl); |
| 243 |
color: var(--c-text-on-hl); |
| 244 |
font-weight: 500; |
| 245 |
} |
| 246 |
|
| 247 |
header nav details summary:hover, header nav a:hover { |
| 248 |
background-color: var(--c-bg); |
| 249 |
} |
| 250 |
|
| 251 |
header nav details summary.highlight:hover, header nav a.highlight:hover { |
| 252 |
background-color: var(--c-hl-secondary); |
| 253 |
color: var(--c-text-on-hl-secondary); |
| 254 |
} |
| 255 |
|
| 256 |
header nav details { |
| 257 |
display: flex; |
| 258 |
flex-direction: column; |
| 259 |
position: relative; |
| 260 |
} |
| 261 |
|
| 262 |
header nav details a { |
| 263 |
padding-inline-start: 2.5rem; |
| 264 |
} |
| 265 |
|
| 266 |
@media screen and (min-width: 800px) { |
| 267 |
header .nav-toggle, header .nav-close, header nav.show .nav-close { |
| 268 |
display: none; |
| 269 |
} |
| 270 |
header nav { |
| 271 |
transform: initial; |
| 272 |
display: flex; |
| 273 |
flex-direction: row; |
| 274 |
justify-content: flex-end; |
| 275 |
position: initial; |
| 276 |
background-color: initial; |
| 277 |
min-width: unset; |
| 278 |
max-width: unset; |
| 279 |
border-inline-start: none; |
| 280 |
} |
| 281 |
header nav.show, header nav:focus-within { |
| 282 |
transform: initial; |
| 283 |
} |
| 284 |
header nav details summary, header nav a { |
| 285 |
border-block-end: none; |
| 286 |
border-inline-start: 1px solid var(--c-border); |
| 287 |
border-inline-end: 1px solid var(--c-border); |
| 288 |
padding: 0 1rem; |
| 289 |
display: flex; |
| 290 |
margin-inline-start: -1px; |
| 291 |
align-items: center; |
| 292 |
height: 100%; |
| 293 |
} |
| 294 |
header nav details:last-of-type summary { |
| 295 |
border-inline-end: none; |
| 296 |
} |
| 297 |
header nav details[open] summary { |
| 298 |
border-block-end: 1px solid var(--c-border); |
| 299 |
height: calc(100% + 1px); |
| 300 |
} |
| 301 |
header nav details div { |
| 302 |
position: absolute; |
| 303 |
right: 0; |
| 304 |
} |
| 305 |
header nav details div a { |
| 306 |
background-color: var(--c-bg-secondary); |
| 307 |
border-block-end: 1px solid var(--c-border); |
| 308 |
padding: 1rem; |
| 309 |
} |
| 310 |
} |
| 311 |
|
| 312 |
main { |
| 313 |
grid-area: main; |
| 314 |
padding: 0 var(--content-inline-padding); |
| 315 |
max-width: var(--content-max-width); |
| 316 |
min-width: 0; |
| 317 |
width: 100%; |
| 318 |
margin: 2rem auto; |
| 319 |
} |
| 320 |
|
| 321 |
nav.article-nav { |
| 322 |
display: flex; |
| 323 |
flex-direction: row; |
| 324 |
justify-content: center; |
| 325 |
} |
| 326 |
|
| 327 |
nav.article-nav div { |
| 328 |
width: 33%; |
| 329 |
text-align: center; |
| 330 |
} |
| 331 |
|
| 332 |
footer { |
| 333 |
grid-area: footer; |
| 334 |
align-self: end; |
| 335 |
background-color: var(--c-bg-secondary); |
| 336 |
border-block-start: 1px solid var(--c-border); |
| 337 |
padding: .5rem var(--content-inline-padding); |
| 338 |
display: flex; |
| 339 |
flex-direction: row; |
| 340 |
flex-wrap: wrap; |
| 341 |
justify-content: space-between; |
| 342 |
} |
| 343 |
|
| 344 |
footer div:last-of-type { |
| 345 |
padding-inline-start: 1rem; |
| 346 |
} |