aboutsummaryrefslogtreecommitdiff
path: root/vanilla.css
blob: 4765d61e07720efcc848c964d8e369545bc0ff92 (plain)
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
/* Reset */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}

* {
    box-sizing: border-box;
}

/* Variables */
:root {
    --desktop-font-size: 1.2rem/1.55;
    --mobile-font-size: 1rem/1.45;
    --text-color: #2d2d2d;
    --link-color: blue;
    --link-color-alt: darkblue;
    --primary-color: lightsteelblue;
    --secondary-color: aliceblue;
    --tertiary-color: whitesmoke;
}

/* Typography */
body {
    color: var(--text-color);
    margin: 0 auto;
    max-width: 75ch;
    padding: 0 0.5rem;
}
body, input {
    font: var(--desktop-font-size) -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto, Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji", "Segoe UI Symbol";
}

h1,h2,h3,h4,h5,h6,p,blockquote,dl,img,figure {
    margin: 2rem 0;
}

h1,h2,h3,h4,h5,h6 { font-weight: bold; line-height: 1.2; }
h1 { font-size: 200%; }
h2 { font-size: 150%; }
h3 { font-size: 120%; }
h4,h5,h6 { font-size: 100%; }
h5, h6 { text-transform: uppercase; }

header h1 { border-bottom: 1px solid; }

a,a:visited { color: var(--link-color); }
a:hover,a:focus { color: var(--link-color-alt); }

strong, time, b { font-weight: bold; }
em, dfn, i { font-style: italic; }
sub { font-size: 60%; vertical-align: bottom; }
small { font-size: 80%; }

blockquote, q {
    background: var(--secondary-color);
    border-left: 10px solid var(--primary-color);
    display: block;
    font-family: "Georgia", serif;
    padding: 1rem;
}
blockquote p:first-child { margin-top: 0; }
blockquote p:last-child { margin-bottom: 0; }
cite {
    font-family: "Georgia", serif;
    font-style: italic;
    font-weight: bold;
    margin-top: 1rem;
}

kbd,code,samp,pre,var { font: var(--mobile-font-size) monospace; }
code, pre {
    background: var(--tertiary-color);
    border: 1px solid;
    overflow: auto;
    padding: 0.25rem 0.5rem;
}
code pre , pre code { border: 0; padding: 0; }

/* Elements */
hr {
    background: var(--text-color);
    border: 0;
    height: 1px;
    margin: 4rem 0;
}

img {
    display: block;
    height: auto; 
    max-width: 100%; 
}

figure {
    border: 1px solid var(--primary-color);
    display: inline-block;
    padding: 1rem;
    width: 100%;
}
figure img { margin: 0 auto; }
figure figcaption { font-size: 80%; margin-top: 0.5rem; text-align: center; }

ul, ol { margin: 2rem 0; padding: 0 0 0 2rem; }
ul li, ol li { margin-bottom: 1rem; }
li > ul, li > ol { margin: 0.25rem 0 0.5rem; padding: 0 0 0 2rem; }
li > ul li, li > ol li { margin-bottom: 0.5rem; }

dl dd { padding-left: 2rem; }

table {
    border: 1px solid var(--primary-color);
    border-collapse: collapse;
    table-layout: fixed;
    text-align: left;
    width: 100%;
}
table caption { margin: 2rem 0; }
table tr { border-bottom: 1px solid var(--primary-color); }
table thead { position: sticky; top: 0; }
table tbody tr:nth-child(even) { background: var(--tertiary-color); }
table th { background: var(--secondary-color); font-weight: bold; }
table th, table td { padding: 0.5rem; }

input { 
    appearance: none; 
    border: 1px solid var(--text-color);
    display: block;
    margin: 0.5rem 0;
    padding: 0.8rem; 
}
input:focus, input:active { background-color: var(--secondary-color); border-color: var(--link-color); }

sup { font-size: 80%; vertical-align: top; }

/* Mobile Styling */
@media screen and (max-width: 75ch) {
    body, input {
        font: var(--mobile-font-size) -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto, Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji", "Segoe UI Symbol";
    }
    table { table-layout: auto; }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: #191919;
    }
    input:focus, input:active {
        background-color: var(--text-color);
        color: var(--secondary-color);
    }
    table,
    table tr,
    table th:not(:last-of-type),
    table td:not(:last-of-type) {
        border-color: var(--text-color);
    }
    table thead th,
    table tfoot th {
        background-color: var(--primary-color-light);
    }
    :root {
        --text-color: #fff;
        --link-color: orange;
        --link-color-alt: yellow;
        --primary-color: orange;
        --primary-color-light: dimgrey;
        --secondary-color: black;
        --tertiary-color: #2d2d2d;
    }
}