51 | I use it to hit the ground running on web projects, so that I don’t 52 | have to worry too much about styling. Aech is built for use with 53 | Source Serif Pro and Inter, but it falls back to system fonts out of 54 | the box. The best way to get started is by reading the source code: 55 |
56 | 57 |/**
58 | * Variable definitions
59 | */
60 | :root {
61 | /* Strokes, light backgrounds, and so on */
62 | --color-wash: #f4f4f4;
63 | /* Light text, low-importance elements, and so on */
64 | --color-light: #9393a8;
65 | /* Buttons and other interface elements you want to highlight */
66 | --color-accent: #8049ff;
67 | /* Body text */
68 | --color-dark: #282851;
69 | /* Interface text */
70 | --color-black: #101020;
71 |
72 | /* Margin, padding, or anything else that needs a size */
73 | --xxl: 60px;
74 | --xl: 40px;
75 | --l: 30px;
76 | --m: 20px;
77 | --s: 15px;
78 | --xs: 10px;
79 | --xxs: 5px;
80 |
81 | /* I usually use sans for interface elements and serif for body text */
82 | --font-family-sans: Inter, system-ui, -apple-system, BlinkMacSystemFont,
83 | Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans,
84 | Helvetica Neue, sans-serif;
85 | --font-family-serif: Source Serif Pro, Iowan Old Style, Apple Garamond,
86 | Baskerville, Times New Roman, Droid Serif, Times, Source Serif Pro, serif,
87 | Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
88 |
89 | /* I usually stick to at most three font weights, since loading fonts is expensive */
90 | --font-weight-thin: 400;
91 | --font-weight-light: 400;
92 | --font-weight-normal: 400;
93 | --font-weight-medium: 500;
94 | --font-weight-bold: 700;
95 |
96 | /* Headings and large text */
97 | --line-height-tight: 1.25;
98 | /* Everything else */
99 | --line-height-normal: 1.5;
100 |
101 | /* Titles */
102 | --font-size-xxl: 36px;
103 | /* Headings */
104 | --font-size-xl: 30px;
105 | /* Subheadings */
106 | --font-size-l: 24px;
107 | /* Body text, especially text in serif */
108 | --font-size-m: 20px;
109 | /* Default for all interface elements */
110 | --font-size-s: 18px;
111 | /* Buttons, navbar links, footer content, and so on */
112 | --font-size-xs: 16px;
113 | /* Breadcrumbs, tags, and smallcaps */
114 | --font-size-xxs: 14px;
115 | }
116 |
117 | /**
118 | * Resets
119 | */
120 |
121 | ::placeholder {
122 | color: var(--color-light);
123 | opacity: 1;
124 | }
125 |
126 | * {
127 | box-sizing: border-box;
128 | padding: 0;
129 | margin: 0;
130 | }
131 |
132 | ul {
133 | list-style: none;
134 | }
135 |
136 | ol {
137 | padding-left: 1.5em;
138 | }
139 |
140 | /* Responsive media */
141 | img,
142 | video {
143 | height: auto;
144 | max-width: 100%;
145 | }
146 |
147 | /**
148 | * Base styles
149 | */
150 | html,
151 | body {
152 | font-size: var(--font-size-s);
153 | font-family: var(--font-family-sans);
154 | font-weight: var(--weight-normal);
155 | font-kerning: normal;
156 | text-rendering: optimizeLegibility;
157 | -webkit-font-smoothing: antialiased;
158 | -moz-osx-font-smoothing: grayscale;
159 | line-height: var(--line-height-normal);
160 | color: var(--color-black);
161 | }
162 |
163 | main {
164 | padding: var(--xl) 0;
165 | }
166 |
167 | h1,
168 | h2,
169 | h3,
170 | h4,
171 | h5,
172 | h6 {
173 | margin: var(--m) 0 var(--xs);
174 |
175 | font-family: var(--font-family-sans);
176 | line-height: var(--line-height-tight);
177 | font-weight: var(--font-weight-bold);
178 | }
179 |
180 | h1 {
181 | font-size: var(--font-size-xxl);
182 | }
183 |
184 | h2 {
185 | font-size: var(--font-size-xl);
186 | }
187 |
188 | h3,
189 | h4,
190 | h5,
191 | h6 {
192 | font-size: var(--font-size-l);
193 | }
194 |
195 | a {
196 | color: inherit;
197 | text-decoration: none;
198 | }
199 |
200 | hr {
201 | margin: var(--xs) 0;
202 |
203 | border: 0;
204 | border-top: 1px solid #f4f4f4;
205 | }
206 |
207 | blockquote {
208 | padding: 0 0 0 var(--m);
209 | margin: var(--m) 0 var(--m) var(--xs);
210 |
211 | border-left: 5px solid var(--color-accent);
212 | }
213 |
214 | table {
215 | width: 100%;
216 |
217 | border-collapse: collapse;
218 | border-spacing: 0;
219 | }
220 |
221 | td,
222 | th {
223 | padding: 0;
224 | }
225 |
226 | input[type="email"],
227 | input[type="password"],
228 | input[type="text"],
229 | textarea {
230 | padding: var(--s) var(--m);
231 | width: 100%;
232 |
233 | color: var(--color-black);
234 | border: 1px solid var(--color-wash);
235 | border-radius: 4px;
236 | }
237 |
238 | input[type="email"]:focus,
239 | input[type="password"]:focus,
240 | input[type="text"]:focus,
241 | textarea:focus {
242 | border-color: var(--color-accent);
243 | }
244 |
245 | .button,
246 | button,
247 | input,
248 | textarea {
249 | padding: 0;
250 |
251 | resize: none;
252 | background: transparent;
253 | border: 0;
254 | outline: 0;
255 | font-family: var(--font-family-sans);
256 | font-size: var(--font-size-xs);
257 | line-height: inherit;
258 | color: inherit;
259 | }
260 |
261 | .button,
262 | button,
263 | input[type="submit"] {
264 | display: inline-flex;
265 | align-items: center;
266 |
267 | cursor: pointer;
268 | font-weight: var(--font-weight-medium);
269 | }
270 |
271 | input[type="submit"] {
272 | margin-top: var(--l);
273 | }
274 |
275 | /**
276 | * Components
277 | */
278 | /* Buttons */
279 | .button--primary,
280 | .button--secondary {
281 | padding: var(--s) var(--xl);
282 |
283 | border-radius: 4px;
284 | }
285 |
286 | .button--primary {
287 | background: var(--color-accent);
288 | color: #fff;
289 | }
290 |
291 | .button--secondary {
292 | border: 1px solid var(--color-wash);
293 | }
294 |
295 | /* Wrapper (wide) and container (narrow) */
296 | .l-wrapper {
297 | max-width: 1300px;
298 | margin: 0 auto;
299 | }
300 |
301 | .l-container {
302 | max-width: 650px;
303 | margin: 0 auto;
304 | }
305 |
306 | /* Navbar */
307 | .l-navbar {
308 | padding: var(--m) 0;
309 | display: flex;
310 | justify-content: space-between;
311 | align-items: center;
312 | position: relative;
313 |
314 | font-size: var(--font-size-xs);
315 | font-weight: var(--font-weight-medium);
316 | color: var(--color-light);
317 | border-bottom: 1px solid var(--color-wash);
318 | }
319 |
320 | .l-navbar__logo {
321 | height: 48px;
322 | width: 48px;
323 | margin-right: var(--s);
324 |
325 | border-radius: 4px;
326 | }
327 |
328 | .l-navbar__brand {
329 | display: flex;
330 | align-items: center;
331 | }
332 |
333 | @media screen and (max-width: 650px) {
334 | .l-navbar__info {
335 | width: 100%;
336 | display: flex;
337 | align-items: center;
338 | justify-content: space-between;
339 | }
340 | }
341 |
342 | .l-navbar__expand {
343 | display: none;
344 | }
345 |
346 | .l-navbar__expand > div {
347 | height: 3px;
348 | width: 24px;
349 | margin-bottom: var(--xxs);
350 |
351 | background: var(--color-light);
352 | }
353 |
354 | .l-navbar__expand > div:last-child {
355 | margin-bottom: 0;
356 | }
357 |
358 | .l-navbar__links ul {
359 | display: flex;
360 | }
361 |
362 | .l-navbar__links li {
363 | margin-left: var(--m);
364 | }
365 |
366 | @media screen and (max-width: 650px) {
367 | .l-navbar {
368 | flex-direction: column;
369 | justify-content: flex-start;
370 | align-items: flex-start;
371 | position: relative;
372 | }
373 |
374 | .l-navbar__expand {
375 | display: block;
376 | }
377 |
378 | .l-navbar__links:not(.is-active) {
379 | display: none;
380 | }
381 |
382 | .l-navbar__links.is-active {
383 | display: block;
384 | position: absolute;
385 | top: 100%;
386 | width: 100%;
387 | padding: var(--m);
388 |
389 | border-radius: 8px;
390 | background: #fff;
391 | box-shadow: 0 0 15px -10px rgba(0, 0, 0, 0.5);
392 | }
393 |
394 | .l-navbar__links ul {
395 | flex-direction: column;
396 | }
397 |
398 | .l-navbar__links li {
399 | margin: calc(var(--xs) / 2) 0;
400 | }
401 | }
402 |
403 | .l-navbar__title {
404 | color: var(--color-black);
405 | }
406 |
407 | .l-navbar__brand:hover .l-navbar__title {
408 | color: var(--color-light);
409 | }
410 |
411 | .l-navbar a:hover {
412 | color: var(--color-black);
413 | }
414 |
415 | /* Page header */
416 | .l-header {
417 | padding: var(--xl) 0;
418 |
419 | border-bottom: 1px solid var(--color-wash);
420 | }
421 |
422 | .l-header h1 {
423 | margin: 0 0 var(--xs) 0;
424 | }
425 |
426 | .l-header__logo {
427 | margin: 0 0 var(--m) 0;
428 | width: 128px;
429 | height: 128px;
430 |
431 | border-radius: 8px;
432 | box-shadow: 0 0 15px -5px rgba(0, 0, 0, 0.5);
433 | }
434 |
435 | .l-header__description {
436 | color: var(--color-light);
437 | }
438 |
439 | .l-header__action {
440 | margin: var(--m) 0 0 0;
441 | }
442 |
443 | /* Page footer */
444 | .l-footer {
445 | padding: var(--xl) 0;
446 |
447 | font-size: var(--font-size-xs);
448 | border-top: 1px solid var(--color-wash);
449 | color: var(--color-light);
450 | }
451 |
452 | .l-footer__title {
453 | color: var(--color-black);
454 | font-weight: var(--font-weight-medium);
455 | }
456 |
457 | .l-footer__links {
458 | margin: var(--m) 0;
459 | }
460 |
461 | .l-footer__links li {
462 | margin: var(--xxs) 0;
463 | }
464 |