-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
downstyler.css
87 lines (66 loc) · 5.17 KB
/
downstyler.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/* ------------------------------------------------------------------------------------------------------------------ */
/* Layout engine improvements */
/* ------------------------------------------------------------------------------------------------------------------ */
/* Make HTML more responsive (adapted from https://github.com/mrmrs/fluidity) */
img, canvas, iframe, video, svg, select, textarea { max-width: 100%; height: auto; }
pre { overflow-x: auto; }
/* Box-model fix (adapted from https://css-tricks.com/box-sizing/) */
html { box-sizing: border-box; }
*, *:before, *:after { box-sizing: inherit; }
/* ------------------------------------------------------------------------------------------------------------------ */
/* Improved typography and prose readability */
/* ------------------------------------------------------------------------------------------------------------------ */
/* Size text according to screen width (adapted from https://css-tricks.com/molten-leading-css/) */
/* Min size: 1rem (16px), max size: 1.2rem (19.2px); dynamic size applies between 600px and 1240px. */
html { font-size: clamp(1rem, calc(13px + 0.5vw), 1.2rem); }
/* Improved text layout and spacing (adapted from http://bettermotherfuckingwebsite.com) */
body { line-height: 1.5; margin: 0 auto; max-width: 40em; padding: 1em; }
p { text-align: justify; hyphens: auto; }
h1, h2, h3, h4, h5, h6 { margin-top: 1em; margin-bottom: 0.5em; line-height: 1.2; }
/* Improved contrast (adapted from https://jgthms.com/web-design-in-4-minutes/#color-contrast) */
body { color: #333; }
:not(a[href]) b, :not(a[href]) strong, th { color: #222; }
/* Logarithmic size scale for headings (see https://github.com/waldyrious/downstyler/issues/30) */
h1 { color: #111; font-size: 200.00%; /* 2^(6/6) */ }
h2 { color: #222; font-size: 178.18%; /* 2^(5/6) */ }
h3 { color: #333; font-size: 158.74%; /* 2^(4/6) */ }
h4 { color: #444; font-size: 141.42%; /* 2^(3/6) */ }
h5 { color: #555; font-size: 125.99%; /* 2^(2/6) */ }
h6 { color: #666; font-size: 112.25%; /* 2^(1/6) */ }
/* Use nicer serif fonts, if available */
body { font-family: 'Libertinus Serif', 'Common Serif', 'Linux Libertine', 'Crimson Text', FreeSerif, serif; }
/* ------------------------------------------------------------------------------------------------------------------ */
/* Simple table style */
/* ------------------------------------------------------------------------------------------------------------------ */
table { border-collapse: collapse; }
th, td { padding-left: .5em; padding-right: 1em; text-align: start; border: 1px solid #ddd; }
th, thead, tfoot { background: #eee; font-weight: bold; }
/* ------------------------------------------------------------------------------------------------------------------ */
/* Forms and form inputs (work in progress, see https://github.com/waldyrious/downstyler/issues/5) */
/* ------------------------------------------------------------------------------------------------------------------ */
textarea { display: block; width: 100%; }
input, textarea, select, button { font-family: inherit; font-size: 100%; margin: 0.2em 0; }
select[size]:not([size="1"]) { vertical-align: top; }
/* ------------------------------------------------------------------------------------------------------------------ */
/* Images and figures */
/* ------------------------------------------------------------------------------------------------------------------ */
/* Add margins to left- and right-aligned images (https://github.com/waldyrious/downstyler/issues/13) */
img[align="right"] { margin-left: 1em; }
img[align="left"] { margin-right: 1em; }
/* Figure captions */
figcaption { font: caption; color: #777; font-size: 75% !important; }
/* Prevent blowing up SVG images that are meant to be small */
*[class*="social"] svg, *[class*="icon"] svg, svg[class*="icon"], img[class*="emoji"][src$=".svg"] { max-height: 30px; }
*[class*="logo" i] svg, *[id*="logo" i] svg { max-width: 100px; }
/* ------------------------------------------------------------------------------------------------------------------ */
/* Additional adjustments */
/* ------------------------------------------------------------------------------------------------------------------ */
/* Softer link colors than the browser defaults */
a[href] { color: RoyalBlue; }
a[href]:visited { color: BlueViolet; }
/* Styles for code-related elements */
pre, :not(pre) code, kbd, samp, tt { padding: .1em .3em; margin: 0 .1em; font-size: 80%; background: #eee; }
/* Styles for blockquote elements */
blockquote { padding-left: 1em; margin-left: 0; border-left: 5px solid #ddd; color: #666; }
/* Softer selection color that works over text and links without the color inversion effect */
::selection { background-color: #def; }