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 */
61
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 ====== */
192: root {
203 --paper : oklch (7 0 0 );
214 --ink : color-mix (in oklab, var (--color ) 5% , black);
@@ -24,8 +7,7 @@ As well as useful links to learn more */
247 --line : 1px solid;
258 --container : 1280px ;
269}
27- /* ====== Base Elements ======
28- General rules for basic HTML elements in any context */
10+
2911body {
3012 background : var (--paper );
3113 color : var (--ink );
@@ -41,26 +23,27 @@ svg {
4123 width : 100% ;
4224 object-fit : cover;
4325}
44- /* ====== Site Layout ======
45- Setting the overall rules for page regions
46- https://www.w3.org/WAI/tutorials/page-structure/regions/
47- */
26+
4827main {
4928 max-width : var (--container );
5029 margin : 0 auto calc (var (--space ) * 4 ) auto;
5130}
31+ header {
32+ text-align : center;
33+ padding : calc (var (--space ) * 2 );
34+ border-bottom : var (--line );
35+ }
5236footer {
5337 position : fixed;
5438 bottom : 0 ;
39+ left : 0 ;
40+ width : 100% ;
41+ background : # 222 ;
42+ color : white;
43+ padding : var (--space );
5544 text-align : center;
5645}
57- /* ====== Articles Grid Layout ====
58- Setting the rules for how articles are placed in the main element.
59- Inspect this in Devtools and click the "grid" button in the Elements view
60- Play with the options that come up.
61- https://developer.chrome.com/docs/devtools/css/grid
62- https://gridbyexample.com/learn/
63- */
46+
6447main {
6548 display : grid;
6649 grid-template-columns : 1fr 1fr ;
@@ -69,13 +52,11 @@ main {
6952 grid-column : span 2 ;
7053 }
7154}
72- /* ====== Article Layout ======
73- Setting the rules for how elements are placed in the article.
74- Now laying out just the INSIDE of the repeated card/article design.
75- Keeping things orderly and separate is the key to good, simple CSS.
76- */
55+
7756article {
57+ background : white;
7858 border : var (--line );
59+ border-radius : 4px
7960 padding-bottom: var (--space );
8061 text-align : left;
8162 display : grid;
0 commit comments