|
1 | | -/* Here are some starter styles |
2 | | -You can edit these or replace them entirely |
3 | | -It's showing you a common way to organise CSS |
4 | | -And includes solutions to common problems |
5 | | -As well as useful links to learn more */ |
6 | 1 |
|
7 | | -/* ====== Design Palette ====== |
8 | | - This is our "design palette". |
9 | | - It sets out the colours, fonts, styles etc to be used in this design |
10 | | - At work, a designer will give these to you based on the corporate brand, but while you are learning |
11 | | - You can design it yourself if you like |
12 | | - Inspect the starter design with Devtools |
13 | | - Click on the colour swatches to see what is happening |
14 | | - I've put some useful CSS you won't have learned yet |
15 | | - For you to explore and play with if you are interested |
16 | | - https://web.dev/articles/min-max-clamp |
17 | | - https://scrimba.com/learn-css-variables-c026 |
18 | | -====== Design Palette ====== */ |
19 | 2 | :root { |
20 | | - --paper: oklch(7 0 0); |
21 | | - --ink: color-mix(in oklab, var(--color) 5%, black); |
| 3 | + --paper: #ffffff; |
| 4 | + --ink: #111111; |
22 | 5 | --font: 100%/1.5 system-ui; |
23 | | - --space: clamp(6px, 6px + 2vw, 15px); |
24 | | - --line: 1px solid; |
25 | | - --container: 1280px; |
| 6 | + --space: clamp(10px, 6px + 2vw, 20px); |
| 7 | + --line: 2px solid #111111; |
| 8 | + --container: 1200px; |
26 | 9 | } |
27 | | -/* ====== Base Elements ====== |
28 | | - General rules for basic HTML elements in any context */ |
| 10 | + |
29 | 11 | body { |
30 | 12 | background: var(--paper); |
31 | 13 | color: var(--ink); |
32 | 14 | font: var(--font); |
| 15 | + margin: 0; |
| 16 | + padding: 0; |
| 17 | + |
| 18 | + padding-bottom: 120px; |
33 | 19 | } |
| 20 | + |
34 | 21 | a { |
35 | | - padding: var(--space); |
| 22 | + display: inline-block; |
| 23 | + color: var(--ink); |
| 24 | + text-decoration: none; |
| 25 | + padding: 8px 16px; |
36 | 26 | border: var(--line); |
37 | 27 | max-width: fit-content; |
| 28 | + font-weight: bold; |
| 29 | + text-transform: uppercase; |
| 30 | + font-size: 0.9rem; |
| 31 | + margin-top: auto; |
| 32 | + max-width: fit-content; |
38 | 33 | } |
39 | | -img, |
40 | | -svg { |
| 34 | + |
| 35 | +a:hover { |
| 36 | + background: var(--ink); |
| 37 | + color: var(--paper); |
| 38 | +} |
| 39 | + |
| 40 | +img { |
41 | 41 | width: 100%; |
| 42 | + height: 250px; |
42 | 43 | object-fit: cover; |
| 44 | + border-bottom: var(--line); |
43 | 45 | } |
44 | | -/* ====== Site Layout ====== |
45 | | -Setting the overall rules for page regions |
46 | | -https://www.w3.org/WAI/tutorials/page-structure/regions/ |
47 | | -*/ |
| 46 | + |
48 | 47 | main { |
49 | 48 | max-width: var(--container); |
50 | 49 | margin: 0 auto calc(var(--space) * 4) auto; |
|
0 commit comments