Index

joshstock.in / a79ac25

Source for serving and static templating/compiling of https://joshstock.in.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
18517 Mar 2023 17:44d24174cUpdate font size for code tags, scroll-margin-top for screen widthsJosh Stockin151G

Blob @ joshstock.in / site / style / core.scss

text/plain13297 bytesdownload raw
1@import 'normalize';
2@import 'fonts';
3@import 'sizes';
4@import 'themes/themes';
5
6
7* {
8 box-sizing: border-box;
9}
10body {
11 display: flex;
12 line-height: 1.65;
13 padding: 0;
14 flex-flow: column;
15 min-height: 100%;
16 color: var(--text-color);
17 overflow-wrap: anywhere;
18 font-family: "Fira Sans", sans-serif;
19 font-size: $base-font-size;
20 text-rendering: optimizeLegibility;
21 background-color: var(--background-color);
22
23 a {
24 color: var(--link-color);
25 text-decoration: none;
26 &:hover {
27 text-decoration: underline;
28 }
29 &:visited {
30 color: var(--link-visited-color);
31 }
32 }
33}
34
35@media print {
36 * {
37 color: #000 !important;
38 white-space: pre-wrap;
39 max-width: 100%;
40 box-sizing: border-box !important;
41 }
42 img.svg.icon {
43 filter: none !important;
44 }
45 a {
46 color: #757575 !important;
47 }
48 div.banner-image {
49 display: none;
50 }
51 div.topbar-container {
52 position: unset;
53 }
54 .header::before {
55 height: 0 !important;
56 }
57 .blog-content {
58 h1, h2, h3, h4, h5, h6, p, pre, table {
59 margin: 0;
60 padding: 0;
61 }
62 }
63 .anchor {
64 display: none;
65 }
66 footer {
67 display: none;
68 }
69}
70
71div.banner-image {
72 width: 100%;
73 height: $base-banner-height;
74 background-image: url(/static/images/river.jpg);
75 background-size: cover;
76 background-position: 50% 30%;
77 transition: transform 1s linear;
78}
79.topbar-container {
80 width: 100%;
81 padding: $base-font-size;
82 font-family: 'Chivo';
83 position: sticky;
84 top: 0;
85 background-color: var(--background-color);
86 z-index: 10;
87 padding-bottom: 0;
88 margin-bottom: $base-font-size;
89 a, a:visited {
90 color: var(--text-color);
91 }
92 ul.topbar {
93 display: flex;
94 flex-wrap: wrap;
95 max-width: $topbar-max-width;
96 margin: 0 auto;
97 padding: 5px 0;
98 line-height: 1.15;
99 list-style: none;
100 border-bottom: 2px solid var(--border-color);
101
102 div.wrap-group {
103 @media (max-width: $topbar-reduce-width) {
104 margin-left: 0;
105 margin-right: $topbar-font-size-reduced;
106 display: inline-block;
107 }
108 }
109
110 li {
111 display: inline-block;
112 white-space: nowrap;
113 font-size: $topbar-font-size;
114 &.hfill {
115 flex: 1;
116 @media (max-width: $topbar-reduce-width) {
117 flex: none;
118 }
119 }
120 &.title {
121 margin-right: $topbar-font-size;
122 }
123 &:not(.title) {
124 @media (max-width: $topbar-reduce-width) {
125 font-size: $topbar-font-size-reduced;
126 padding: 4px 0;
127 vertical-align: middle;
128 }
129 }
130 &:not(.hfill):hover {
131 position: relative;
132 top: 1px;
133 transition: transform 0.3s linear;
134 cursor: pointer;
135 }
136 &:not(.title):not(.hfill):not(:last-of-type) {
137 margin-right: $topbar-font-size/2;
138 }
139 svg {
140 display: inline-block;
141 height: $topbar-font-size;
142 vertical-align: middle;
143 }
144 }
145 }
146}
147
148div.content-container {
149 display: flex;
150 flex-flow: column;
151 flex: 1;
152 width: 100%;
153 padding: 0 16px;
154
155 div.content-body {
156 width: 100%;
157 max-width: $page-max-width;
158 margin: 0 auto;
159
160 div.blog-metadata, div.blog-listing {
161 margin-bottom: 1.5em;
162 .title {
163 margin: 0 0 0.25em 0;
164 line-height: 1.25;
165 }
166 p {
167 margin: 0;
168 .readtime {
169 margin-left: 0.5em;
170 }
171 }
172 p.description {
173 margin-bottom: 0.5em;
174 }
175 a, a:visited {
176 color: var(--text-color);
177 &:not(.thumb):hover {
178 text-decoration: none;
179 border-bottom: 1px solid var(--text-color);
180 }
181 }
182 }
183
184 div.blog-listing {
185 display: flex;
186 flex: column;
187 height: fit-content;
188 min-height: 200px;
189 border-top: 1px solid var(--border-color);
190 padding-top: 1.5em;
191 a.blog-banner.thumb {
192 height: 100%;
193 padding-right: 1em;
194 flex: 1;
195 div {
196 width: 100%;
197 min-height: 200px;
198 height: 100%;
199 background-size: cover;
200 background-position: center;
201 }
202 }
203 .blog-listing-container {
204 flex: 2;
205 }
206 @media (max-width: $page-compress-width) {
207 display: block;
208 a.blog-banner.thumb {
209 height: 200px;
210 width: 100%;
211 padding-right: 0;
212 }
213 .blog-listing-container {
214 margin-top: 1em;
215 margin-bottom: 2em;
216 }
217 }
218 }
219
220 div.blog-content {
221 margin: 1em 0;
222 border-bottom: 1px solid var(--border-color);
223 }
224
225 div.blog-end {
226 p {
227 margin-top: 1em;
228 }
229 }
230
231 iframe {
232 width: 100%;
233 height: 600px;
234 border: 1px solid var(--border-color);
235 margin-bottom: 1em;
236 }
237
238 hr {
239 border: 1px solid var(--border-color);
240 margin-bottom: 1.5em;
241 }
242 h1, h2, h3, h4, h5, h6, p, pre {
243 padding: 0;
244 word-wrap: break;
245 }
246 p, pre {
247 line-height: 1.65;
248 }
249
250 h1, h2, h3, h4, h5, h6 {
251 margin: 1.5em 0 0.5em 0;
252 line-height: 1.25;
253 &:first-child {
254 margin: 0;
255 }
256 &.header {
257 position: relative;
258 scroll-margin-top: 70px;
259 @media (max-width: $page-compress-width + $base-font-size*8) {
260 scroll-margin-top: 130px;
261 }
262 .anchor {
263 opacity: 0.3;
264 position: absolute;
265 left: -$base-font-size*2;
266 top: calc(50% - #{$base-font-size/2});
267 .svg {
268 vertical-align: middle;
269 width: $base-font-size;
270 height: $base-font-size;
271 }
272 &:hover {
273 opacity: 0.6;
274 }
275 @media (max-width: $page-compress-width + $base-font-size*8) {
276 position: unset;
277 margin-left: 6px;
278 }
279 }
280 }
281 }
282
283 p {
284 margin: 1em 0 1em 0;
285 &:first-of-type {
286 margin-top: 0;
287 }
288 }
289
290 blockquote {
291 padding: 1em;
292 margin: 0.5em 0;
293 border-left: 8px solid var(--border-color);
294 background-color: var(--blockquote-background-color);
295 p:last-of-type {
296 margin-bottom: 0;
297 }
298 }
299
300 ul, ol {
301 padding-left: 0;
302 li {
303 position: relative;
304 margin-bottom: 0.5em;
305 margin-left: 0;
306 left: 1.5em;
307 margin-right: 1.5em;
308 }
309 }
310
311 div.codehilite {
312 border: 1px solid var(--border-color);
313 border-radius: 4px;
314 padding: 0;
315 margin: 0 0 1em 0;
316 background-color: var(--code-background-color);
317 pre {
318 padding: 1em;
319 margin: 0;
320 overflow-x: auto;
321 font-size: 0.8em;
322 }
323 }
324
325 code:not(.codehilite *) {
326 border: 1px solid var(--border-color);
327 border-radius: 4px;
328 padding: 0 2px;
329 background-color: var(--code-background-color);
330 color: var(--code-text-color);
331 font-size: 0.85em;
332 }
333
334 img, video {
335 position: relative;
336 z-index: 3;
337 max-width: 100%;
338 &.inline.svg {
339 height: 1em;
340 vertical-align: middle;
341 display: inline-block;
342 top: -1.5px;
343 }
344 &.small {
345 max-height: $content-image-small-height;
346 }
347 &.medium {
348 max-height: $content-image-medium-height;
349 }
350 }
351
352 table:not(#commento table) {
353 table-layout: auto;
354 max-width: 100%;
355 overflow-x: auto;
356 width: 100%;
357 border-spacing: 0;
358 border: 1px solid var(--border-color);
359 border-radius: 4px;
360 margin-bottom: 1em;
361 tr {
362 &:first-child, th {
363 font-weight: bolder;
364 background-color: var(--code-background-color);
365 td:first-child {
366 border-top-left-radius: 4px;
367 }
368 td:last-child {
369 border-top-right-radius: 4px;
370 }
371 }
372 &:not(:last-child) td {
373 border-bottom: 1px solid var(--border-color);
374 }
375 }
376 td {
377 padding: 4px 8px;
378 margin: 0;
379 &:not(:last-child) {
380 border-right: 1px solid var(--border-color);
381 }
382 }
383 }
384
385 iframe.full {
386 width: calc(100% - #{$content-image-float-offset*2 + $base-font-size*2});
387 margin-left: $content-image-float-offset;
388 @media (max-width: $figure-compress-width) {
389 & {
390 width: 100%;
391 margin-left: 0;
392 }
393 }
394 }
395 figure.heading-aligned {
396 margin-top: 1em !important;
397 }
398 figure {
399 display: table;
400 margin: 0;
401 &.float-left {
402 float: left;
403 position: relative;
404 left: $content-image-float-offset;
405 margin: 0 $content-image-float-offset+$base-font-size 8px 0;
406 }
407 &.float-right {
408 float: right;
409 position: relative;
410 right: $content-image-float-offset;
411 margin: 0 0 8px $content-image-float-offset+$base-font-size;
412 }
413 &.full {
414 display: block;
415 width: 100%;
416 img, video {
417 display: block;
418 margin: 0 auto;
419 }
420 figcaption {
421 display: block;
422 }
423 }
424 @media (max-width: $page-compress-width) {
425 &:not(.full) {
426 display: flex;
427 flex-direction: column;
428 max-width: 100% !important;
429 float: none;
430 width: fit-content;
431 align-items: center;
432 margin: 0 auto 8px auto !important;
433 img, video {
434 display: block;
435 max-width: 100%;
436 margin: 0 auto;
437 }
438 figcaption {
439 display: block;
440 margin: 1em auto 0 auto;
441 }
442 }
443 }
444 @media (max-width: $figure-compress-width) {
445 &:not(.full) {
446 max-width: 50%;
447 }
448 &.float-left {
449 position: inherit;
450 left: 0;
451 margin: 0 16px 8px 0;
452 }
453 &.float-right {
454 position: inherit;
455 right: 0;
456 margin: 0 0 8px 16px;
457 }
458 }
459 figcaption {
460 display: table-caption;
461 caption-side: bottom;
462 margin-top: 1em;
463 text-align: center;
464 width: 100%;
465 }
466 }
467 }
468
469 figcaption {
470 font-size: $figure-font-size;
471 margin-top: 4px;
472 color: var(--caption-color);
473 }
474
475 div.vfill {
476 flex: 1;
477 }
478
479 footer {
480 max-width: 1000px;
481 width: 100%;
482 margin: 64px auto 32px auto;
483 text-align: center;
484 border-top: 2px solid var(--border-color);
485 padding-top: 16px;
486 &>p {
487 margin: 0;
488 }
489 }
490}
491