-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathclassless-essentials.css
212 lines (187 loc) · 6.89 KB
/
classless-essentials.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
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
/* Classless.css v1.0
Table of Contents:
1. Theme Settings
2. Reset
3. Base Style
4. Extras (remove unwanted)
5. Classes (remove unwanted)
*/
/* 1. Theme Settings ––––––––––––––––––––-–––––––––––––– */
:root, html[data-theme='light'] {
--rem: 12pt;
--width: 50rem;
--navpos: absolute; /* fixed | absolute */
--font-p: 1em/1.7 'Open Sans', 'DejaVu Sans', FreeSans, Helvetica, sans-serif;
--font-h: .9em/1.5 'Open Sans', 'DejaVu Sans', FreeSans, Helvetica, sans-serif;
--font-c: .9em/1.4 'DejaVu Sans Mono', monospace;
--border: 1px solid var(--cmed);
--ornament: "";
/* foreground | background color */
--cfg: #433; --cbg: #fff;
--cdark: #888; --clight: #f5f6f7;
--cmed: #d1d1d1;
--clink: #07c;
--cemph: #088; --cemphbg: #0881;
}
/* 2. Reset –––––––––––––––––––––––––––––––––––––––––––– */
/* reset block elements */
* { box-sizing: border-box; border-spacing: 0; margin: 0; padding: 0;}
header, footer, figure, table, video, details, blockquote,
ul, ol, dl, fieldset, pre, pre > code, caption {
display: block;
margin: 0.5rem 0rem 1rem;
width: 100%;
overflow: auto hidden;
text-align: left;
}
video, summary, input, select { outline:none; }
/* reset clickable things (FF Bug: select:hover prevents usage) */
a, button, select, summary { color: var(--clink); cursor: pointer; }
/* 3. Base Style ––––––––––––––––––––––––––––––––––––––– */
html { font-size: var(--rem); background: var(--cbg); }
body {
position: relative;
margin: auto;
max-width: var(--width);
font: var(--font-p);
color: var(--cfg);
padding: 3.0rem 0.6rem 0;
overflow-x: hidden;
}
body > footer { margin: 10rem 0rem 0rem; font-size: 90%; }
p { margin: .6em 0; }
/* links */
a[href]{ text-decoration: underline solid var(--cmed); text-underline-position: under; }
a[href^="#"] {text-decoration: none; }
a:hover, button:not([disabled]):hover, summary:hover {
filter: brightness(92%); color: var(--cemph); border-color: var(--cemph);
}
/* lists */
ul, ol, dl { margin: 1rem 0; padding: 0 0 0 2em; }
li:not(:last-child), dd:not(:last-child) { margin-bottom: 0.5rem; }
dt { font-weight: bold; }
/* headings */
h1, h2, h3, h4, h5 { font: var(--font-h); }
h1+h2, h2+h3, h3+h4, h4+h5 { margin-top: .5em; padding-top: 0; } /* non-clashing headings */
h1 { font-size: 2.2em; font-weight: 300; }
h2 { font-size: 2.0em; font-weight: 300; font-variant: small-caps; }
h3 { font-size: 1.5em; font-weight: 400; }
h4 { font-size: 1.1em; font-weight: 700; }
h5 { font-size: 1.2em; font-weight: 400; color: var(--cfg); }
h6 { font-size: 1.0em; font-weight: 700; font-style: italic; display: inline; }
h6 + p { display: inline; }
/* tables */
td, th {
padding: 0.5em 0.8em;
text-align: right;
border-bottom: 0.1rem solid var(--cmed);
white-space: nowrap;
font-size: 95%;
}
thead th[colspan] { padding: .2em 0.8em; text-align: center; }
thead tr:not(:only-child) td { padding: .2em 0.8em; }
thead+tbody tr:first-child td { border-top: 0.1rem solid var(--cdark); }
td:first-child, th:first-child { text-align: left; }
tr:hover{ background-color: var(--clight); }
table img { display: block; }
/* figures */
img, svg { max-width: 100%; vertical-align: text-top; object-fit: cover; }
p>img:not(:only-child) { float: right; margin: 0 0 .5em .5em; }
figure > img { display: inline-block; width: auto; }
figure > img:only-of-type, figure > svg:only-of-type { max-width: 100%; display: block; margin: 0 auto 0.4em; }
figcaption, caption { font: var(--font-h); color: var(--cdark); width: 100%; }
figcaption > *:first-child, caption > *:first-child { display: inline-block; margin: 0; }
figure > *:not(:last-child) { margin-bottom: 0.4rem; }
/* code */
pre > code {
margin: 0;
position: relative;
padding: 0.8em;
border-left: .4rem solid var(--cemph);
}
code, kbd, samp {
padding: 0.2em;
font: var(--font-c);
background: var(--clight);
border-radius: 4px;
}
kbd { border: 1px solid var(--cmed); }
/* misc */
blockquote { border-left: 0.4rem solid var(--cmed); padding: 0 0 0 1rem; }
time{ color: var(--cdark); }
hr { border: 0; border-top: 0.1rem solid var(--cmed); }
nav { width: 100%; background-color: var(--clight); }
::selection, mark { background: var(--clink); color: var(--cbg); }
/* 4. Extra Style –––––––––––––––––––––––––––––––––––––– */
/* subfigures */
figure { counter-reset: subfig 0 }
article figure figure { counter-reset: none; }
article figure > figure { display: inline-grid; width: auto; }
figure > figure:not(:last-of-type) { padding-right: 1rem; }
article figure figure figcaption:before {
counter-increment: subfig 1;
content: counter(subfig, lower-alpha) ": ";
}
/* listings */
article figure pre + figcaption:before {
counter-increment: lst 1;
content: "Listing " counter(lst) ": ";
}
/* tables */
figure > table:only-of-type { display: table; margin: 0.5em auto !important; width: fit-content; }
article figure > table caption { display: table-caption; caption-side: bottom; }
article figure > table + figcaption:before,
article table caption:before {
color: var(--cemph);
counter-increment: tab 1;
content: "Table " counter(tab) ": ";
}
/* navbar */
nav+* { margin-top: 3rem; }
body>nav, header nav {
position: var(--navpos);
top: 0; left: 0; right: 0;
z-index: 41;
box-shadow: 0vw -50vw 0 50vw var(--clight), 0 calc(-50vw + 2px) 4px 50vw var(--cdark);
}
nav ul { list-style-type: none; }
nav ul:first-child { margin: 0; padding: 0; overflow: visible; }
nav ul:first-child > li {
display: inline-block;
margin: 0;
padding: 0.8rem .6rem;
}
nav ul > li > ul {
display: none;
width: auto;
position: absolute;
margin: 0.5rem 0;
padding: 1rem 2rem;
background-color: var(--clight);
border: var(--border);
border-radius: 4px;
z-index: 42;
}
nav ul > li > ul > li { white-space: nowrap; }
nav ul > li:hover > ul { display: block; }
@media (max-width: 40rem) {
nav ul:first-child > li:first-child:after { content: " \25BE"; }
nav ul:first-child > li:not(:first-child):not(.sticky) { display: none; }
nav ul:first-child:hover > li:not(:first-child):not(.sticky) { display: block; float: none !important; }
}
summary:hover, details[open] summary, .card>p:first-child {
box-shadow: inset 0 0 0 2em var(--clight), 0 -.8rem 0 .8rem var(--clight);
}
.hint { --cmed: var(--cemph); --clight: var(--cemphbg); background-color: var(--clight); }
.warn { --cmed: #c11; --clight: #e221; background-color: var(--clight); }
/* be print-friendly */
@media print {
@page { margin: 1.5cm 2cm; }
html {font-size: 9pt!important; }
body { max-width: 27cm; }
p { orphans: 2; widows: 2; }
caption, figcaption { page-break-before: avoid; }
h2, h3, h4, h5 { page-break-after: avoid;}
.noprint, body>nav, section:after { display: none; }
.row { flex-direction: row; }
}