Debian Codegraph @

docs/_sass/_layout.scss

raw
1 $mobile-width: 768px;
2 $tablet-width: 1024px;
3 $container-width: 1200px;
4 $hero-header-font: "Jacquard 24";
5 $header-font: "Lancelot";
6 $body-font: "Asul";
7
8 // Mixin for responsive table styles
9 @mixin responsive-table($theme-map) {
10 overflow-x: auto;
11 -webkit-overflow-scrolling: touch;
12 margin: 1em auto;
13
14 &.stack {
15 thead {
16 display: none;
17 }
18
19 tr {
20 border-bottom: 0.125em solid rgba(map-get($theme-map, primary-color), 0.2);
21 margin-bottom: 1em;
22
23 &:last-child {
24 border-bottom: none;
25 margin-bottom: 0;
26 }
27 }
28
29 td {
30 text-align: right;
31 padding: 0.6em 1em;
32 border-bottom: 0.0625em solid
33 rgba(map-get($theme-map, primary-color), 0.1);
34
35 &:before {
36 content: attr(data-label);
37 float: left;
38 font-family: $header-font, cursive;
39 color: map-get($theme-map, primary-color);
40 font-weight: 400;
41 }
42
43 &:last-child {
44 border-bottom: none;
45 }
46 }
47 }
48 }
49
50 // Mixin for responsive image showcase styles
51 @mixin responsive-image-showcase {
52 flex-direction: column;
53
54 .row {
55 flex-direction: column;
56 gap: 1em;
57 }
58
59 img.half-image {
60 width: 100%;
61 margin-bottom: 0;
62 }
63 }
64
65 @mixin responsive-code-highlight($theme-map) {
66 .highlighter-rouge {
67 padding: 0;
68 background: none;
69 border: none;
70
71 .highlight {
72 flex-direction: column;
73 align-items: stretch;
74 padding: 0;
75
76 pre.highlight {
77 margin: 0;
78 -webkit-overflow-scrolling: touch;
79 padding: 0.5em 0.5em 0.5em 1em;
80 scrollbar-width: none;
81 border-radius: map-get($theme-map, border-radius);
82
83 code {
84 font-size: 1em;
85 padding: 0;
86 }
87 }
88
89 .copy-btn {
90 flex-grow: 1;
91 }
92 }
93 }
94 code.highlighter-rouge {
95 font-size: 0.6em;
96 word-wrap: break-word;
97 }
98 }
99
100 @mixin themable($theme-name, $theme-map) {
101 [data-theme="#{$theme-name}"] {
102 // Global styles
103 body {
104 background: map-get($theme-map, background-color);
105 color: map-get($theme-map, text-color);
106 font-family: $body-font, sans-serif;
107 font-weight: 400;
108 font-style: normal;
109 line-height: 1.4;
110 margin: 0;
111 padding: 0;
112 }
113
114 a {
115 text-shadow: none;
116 color: map-get($theme-map, highlight-color);
117 text-decoration: none;
118
119 &:hover {
120 color: lighten(map-get($theme-map, highlight-color), 5%);
121 }
122 }
123
124 h1,
125 h2,
126 h3,
127 h4,
128 h5,
129 h6 {
130 color: map-get($theme-map, header-color);
131 font-weight: 400;
132 font-style: normal;
133 position: relative;
134 margin: 0;
135 line-height: 1.2em;
136 text-shadow: map-get($theme-map, header-text-shadow);
137 &:hover {
138 color: lighten(map-get($theme-map, header-color), 10%);
139 }
140
141 &:hover .heading-anchor {
142 opacity: 1;
143 }
144
145 .heading-link {
146 display: block;
147 position: relative;
148 -webkit-tap-highlight-color: transparent;
149
150 &:hover {
151 color: map-get($theme-map, header-color);
152
153 .heading-anchor {
154 opacity: 1;
155 }
156 }
157 }
158 }
159
160 h1 a,
161 h2 a,
162 h3 a,
163 h4 a,
164 h5 a,
165 h6 a {
166 text-shadow: map-get($theme-map, header-text-shadow);
167 }
168
169 h1 {
170 font-family: $hero-header-font, cursive;
171 margin: 0.3em 0;
172 font-size: 3em;
173 padding: 0;
174 border: none;
175 position: relative;
176
177 a {
178 color: map-get($theme-map, header-color);
179 position: relative;
180 display: inline-block;
181
182 &:hover {
183 color: lighten(map-get($theme-map, header-color), 10%);
184 }
185 }
186 }
187
188 h2,
189 h3,
190 h4,
191 h5,
192 h6 {
193 font-family: $header-font, serif;
194 }
195
196 h2 {
197 font-size: 2em;
198 }
199
200 h3 {
201 font-size: 1.5em;
202 text-wrap: balance;
203 }
204
205 h4 {
206 font-size: 1.2em;
207 }
208
209 p {
210 margin-bottom: 1.2em;
211 }
212
213 ol,
214 p,
215 table,
216 ul {
217 text-shadow: map-get($theme-map, body-text-shadow);
218 }
219
220 code {
221 font-family: monospace;
222 background: none;
223 padding: 0;
224 }
225
226 pre {
227 margin: 0;
228 padding: 0;
229 background: none;
230 }
231
232 // Header styles
233 header {
234 text-align: center;
235 margin-bottom: 0;
236 border-bottom: 0.125em solid map-get($theme-map, secondary-color);
237
238 h1 {
239 font-size: 4em;
240 margin: 0;
241 padding: 0;
242 text-shadow: none;
243 border: none;
244 transform-style: preserve-3d;
245 transform: perspective(1000px) rotateX(3deg);
246 transition: transform 0.3s ease;
247
248 &:hover {
249 transform: perspective(1000px) rotateX(0deg) translateY(-3px);
250 }
251
252 a {
253 color: map-get($theme-map, header-color);
254 position: relative;
255 display: inline-block;
256 transform-style: preserve-3d;
257
258 &:before {
259 content: attr(data-text);
260 position: absolute;
261 left: 0;
262 top: 0;
263 color: rgba(255, 255, 255, 0.3);
264 transform: translateZ(-20px);
265 filter: blur(2px);
266 }
267
268 &:after {
269 content: attr(data-text);
270 position: absolute;
271 left: 0;
272 top: 0;
273 color: rgba(0, 0, 0, 0.3);
274 transform: translateZ(-10px);
275 filter: blur(1px);
276 }
277
278 &:hover {
279 color: lighten(map-get($theme-map, header-color), 10%);
280 }
281 }
282 }
283
284 h2 {
285 font-family: $body-font, sans-serif;
286 font-size: 1em;
287 margin: 0.625em 0;
288 border: none;
289 }
290 }
291
292 ul {
293 padding-left: 1em;
294 }
295
296 ol {
297 padding-left: 1em;
298 margin-top: revert;
299 margin-bottom: revert;
300 }
301
302 li {
303 margin-bottom: 0.5em;
304 }
305
306 // Footer styles
307 footer {
308 text-align: center;
309 margin-top: 40px;
310 padding: 20px;
311 background: rgba(map-get($theme-map, background-color), 0.3);
312 border-radius: map-get($theme-map, border-radius);
313
314 p {
315 margin: 0;
316 }
317 }
318
319 .shell {
320 max-width: $container-width;
321 padding: 0 1.25em 1.25em;
322 background: rgba(map-get($theme-map, page-color), 0.9);
323 box-shadow: 0 0 1.25em map-get($theme-map, border-color);
324 font-size: 1.5em;
325 }
326
327 .image-showcase {
328 display: flex;
329 justify-content: space-between;
330 flex-wrap: wrap;
331 gap: 1em;
332 margin: 1em 0;
333
334 .row {
335 display: flex;
336 justify-content: space-between;
337 width: 100%;
338 gap: 1em;
339 }
340
341 img.full-image {
342 aspect-ratio: 16/9;
343 width: 100%;
344 height: auto;
345 }
346
347 img.half-image {
348 aspect-ratio: 4/3;
349 width: calc(50% - 0.5em);
350 height: auto;
351 }
352 }
353
354 // Button styles
355 .btn {
356 display: inline-block;
357 padding: 0.5em;
358 font-family: $header-font, cursive;
359 font-size: 1.1em;
360 text-align: center;
361 text-decoration: none;
362 border-radius: map-get($theme-map, border-radius);
363 cursor: pointer;
364 transition: all 0.3s ease;
365 border: 0.125em solid transparent;
366 box-shadow: 0 0.25em 0.5em rgba(0, 0, 0, 0.2);
367 position: relative;
368 overflow: hidden;
369
370 &:hover {
371 transform: translateY(-2px);
372 box-shadow: 0 0.5em 1em rgba(0, 0, 0, 0.3);
373 }
374
375 &:active {
376 transform: translateY(1px);
377 box-shadow: 0 0.125em 0.25em rgba(0, 0, 0, 0.2);
378 }
379
380 // Primary button
381 &.btn-primary {
382 background: map-get($theme-map, primary-color);
383 color: map-get($theme-map, background-color);
384 border-color: map-get($theme-map, primary-color);
385
386 &:hover {
387 background: darken(map-get($theme-map, primary-color), 10%);
388 }
389 }
390
391 // Secondary button
392 &.btn-secondary {
393 background: map-get($theme-map, secondary-color);
394 color: map-get($theme-map, primary-color);
395 border-color: map-get($theme-map, secondary-color);
396
397 &:hover {
398 background: darken(map-get($theme-map, secondary-color), 10%);
399 }
400 }
401
402 // Outline button
403 &.btn-outline {
404 background: transparent;
405 color: map-get($theme-map, primary-color);
406 border-color: map-get($theme-map, primary-color);
407
408 &:hover {
409 background: rgba(map-get($theme-map, primary-color), 0.1);
410 }
411 }
412
413 // Disabled state
414 &:disabled,
415 &.disabled {
416 opacity: 0.6;
417 cursor: not-allowed;
418 pointer-events: none;
419 }
420 }
421
422 .theme-toggle-container {
423 display: flex;
424 font-size: 0.5em;
425 justify-content: end;
426 margin: 1.25em 0em;
427
428 .btn {
429 &.btn-primary {
430 color: map-get($theme-map, inverse-text-color);
431 background: map-get($theme-map, inverse-background-color);
432 border-color: map-get($theme-map, inverse-border-color);
433
434 &:hover {
435 background: map-get($theme-map, inverse-primary-color);
436 }
437 }
438 }
439 }
440
441 hr {
442 border: none;
443 border-top: 0.125em solid rgba(map-get($theme-map, secondary-color), 0.4);
444 margin: 2em 0;
445 }
446
447 #main_content img {
448 max-width: 100%;
449 height: auto;
450 }
451
452 @media screen and (min-width: $tablet-width) {
453 .shell {
454 border: 0.125em solid map-get($theme-map, border-color);
455 border-radius: map-get($theme-map, border-radius);
456 margin: 1.25em;
457 }
458
459 #main_content {
460 padding: 1.25em;
461 }
462 }
463
464 @media screen and (min-width: $container-width) {
465 .shell {
466 margin: 1.25em auto;
467 }
468 }
469
470 .highlighter-rouge {
471 background: rgba(map-get($theme-map, primary-color), 0.05);
472 padding: 0;
473 border-radius: map-get($theme-map, border-radius);
474 position: relative;
475 border: 0.0625em solid rgba(map-get($theme-map, primary-color), 0.1);
476 margin-bottom: 1.2em;
477
478 .highlight {
479 padding: 0.7em;
480 scrollbar-width: none;
481 -webkit-overflow-scrolling: touch;
482 background: none;
483 position: relative;
484 overflow-x: auto;
485 display: flex;
486 justify-content: space-between;
487 gap: 1em;
488 align-items: center;
489
490 pre.highlight {
491 background: rgba(map-get($theme-map, code-background-color), 0.5);
492 border-radius: map-get($theme-map, border-radius);
493 flex-grow: 1;
494
495 code {
496 display: block;
497 white-space: pre;
498 padding: 0;
499 }
500 }
501 }
502 }
503
504 code.highlighter-rouge {
505 padding: 0.5em;
506 font-size: 0.8em;
507 background: rgba(map-get($theme-map, code-background-color), 0.5);
508 }
509
510 // Heading anchor links
511 .heading-anchor {
512 opacity: 0;
513 font-size: min(1em, 24px);
514 margin-left: 0.5em;
515 text-decoration: none;
516 vertical-align: middle;
517 transition: all 0.3s ease;
518 color: lighten(map-get($theme-map, header-color), 10%);
519 display: inline-block;
520 cursor: copy;
521
522 &:hover {
523 opacity: 1 !important;
524 transform: scale(1.1);
525 }
526 }
527
528 table {
529 width: 100%;
530 border-collapse: separate;
531 border-spacing: 0;
532 margin: 1.5em 0;
533 background: darken(map-get($theme-map, primary-color), 20%);
534 border: 0.1em solid rgba(map-get($theme-map, secondary-color), 0.6);
535 border-radius: map-get($theme-map, border-radius);
536 overflow: hidden;
537 box-shadow: 0 0.125em 0.25em
538 rgba(map-get($theme-map, secondary-color), 0.1);
539
540 th {
541 background: rgba(map-get($theme-map, background-color), 0.6);
542 color: map-get($theme-map, primary-color);
543 font-family: $header-font, cursive;
544 font-weight: 400;
545 padding: 1em;
546 text-align: left;
547 border-bottom: 0.125em solid
548 rgba(map-get($theme-map, secondary-color), 0.3);
549 font-size: 1.1em;
550 white-space: nowrap;
551 position: sticky;
552 top: 0;
553 z-index: 1;
554 backdrop-filter: blur(4px);
555 }
556
557 td {
558 padding: 0.8em 1em;
559 border-bottom: 0.0625em solid
560 rgba(map-get($theme-map, primary-color), 0.1);
561 vertical-align: middle;
562 line-height: 1.4;
563 }
564
565 tr {
566 color: map-get($theme-map, table-text-color);
567 }
568 tr:last-child td {
569 border-bottom: none;
570 }
571
572 tr:hover {
573 background: rgba(map-get($theme-map, secondary-color), 0.05);
574 }
575 }
576
577 // Portrait mobile styles
578 @media screen and (max-width: $mobile-width) and (orientation: portrait) {
579 @include responsive-code-highlight($theme-map);
580
581 .heading-anchor {
582 display: none !important;
583 }
584
585 .shell {
586 padding: 0.625em;
587 font-size: 1.5em;
588 }
589
590 img.game-screenshot {
591 width: 100%;
592 height: auto;
593 }
594
595 table {
596 @include responsive-table($theme-map);
597 display: block;
598
599 &.stack {
600 tr {
601 display: block;
602 }
603
604 td {
605 display: block;
606 }
607 }
608 }
609
610 .image-showcase {
611 @include responsive-image-showcase;
612 }
613 }
614
615 // Landscape mobile styles
616 @media screen and (max-width: $tablet-width) and (orientation: landscape) {
617 body {
618 font-size: 0.6em;
619 }
620 @include responsive-code-highlight($theme-map);
621
622 .heading-anchor {
623 display: none !important;
624 }
625
626 .shell {
627 padding: 0.625em;
628 font-size: 1.8em;
629 }
630
631 img.game-screenshot {
632 width: 100%;
633 height: auto;
634 }
635
636 table {
637 @include responsive-table($theme-map);
638 }
639
640 .image-showcase {
641 @include responsive-image-showcase;
642 }
643 }
644 }
645 }
646
647 @include themable(light, $light);
648 @include themable(dark, $dark);