Skip to content

Commit ac0496b

Browse files
authored
Refactor CSS by removing comments and updating layout
improved the css to accommodate the addition of links in the html code
1 parent 43c7f33 commit ac0496b

1 file changed

Lines changed: 30 additions & 40 deletions

File tree

Wireframe/style.css

Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
1-
/* Here are some starter styles
2-
You can edit these or replace them entirely
3-
It's showing you a common way to organize CSS
4-
And includes solutions to common problems
5-
As well as useful links to learn more */
6-
7-
/* ====== Design Palette ======
8-
This is our "design palette".
9-
It sets out the colors, 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 color 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 ====== */
191
:root {
202
--color: #0056b3;
213
--paper: oklch(98 0 0);
@@ -25,8 +7,7 @@ As well as useful links to learn more */
257
--line: 1px solid;
268
--container: 1280px;
279
}
28-
/* ====== Base Elements ======
29-
General rules for basic HTML elements in any context */
10+
3011
body {
3112
background: var(--paper);
3213
color: var(--ink);
@@ -47,10 +28,7 @@ svg {
4728
width: 100%;
4829
object-fit: cover;
4930
}
50-
/* ====== Site Layout ======
51-
Setting the overall rules for page regions
52-
https://www.w3.org/WAI/tutorials/page-structure/regions/
53-
*/
31+
5432
main {
5533
max-width: var(--container);
5634
margin: 0 auto calc(var(--space) * 4) auto;
@@ -64,14 +42,7 @@ footer {
6442
padding: var(--space) 0;
6543
border-top: var(--line);
6644
}
67-
/* ====== Articles Grid Layout ====
68-
Setting the rules for how articles are placed in the main element.
69-
Inspect this in Devtools and click the "grid" button in the Elements view
70-
Play with the options that come up.
71-
https://developer.chrome.com/docs/devtools/css/grid
72-
https://gridbyexample.com/learn/
73-
*/
74-
/* ====== Articles Grid Layout ==== */
45+
7546
main {
7647
display: grid;
7748
grid-template-columns: 1fr 1fr;
@@ -81,22 +52,41 @@ main {
8152
main > *:first-child {
8253
grid-column: span 2;
8354
}
84-
}
85-
/* ====== Article Layout ======
86-
Setting the rules for how elements are placed in the article.
87-
Now laying out just the INSIDE of the repeated card/article design.
88-
Keeping things orderly and separate is the key to good, simple CSS.
89-
*/
55+
9056
article {
9157
border: var(--line);
9258
padding-bottom: var(--space);
9359
text-align: left;
9460
display: grid;
9561
grid-template-columns: var(--space) 1fr var(--space);
96-
> * {
62+
article > * {
9763
grid-column: 2/3;
9864
}
99-
> img {
65+
article > img {
10066
grid-column: 1 / -1;
10167
}
10268
}
69+
70+
summary {
71+
cursor: pointer;
72+
padding: 10px;
73+
background-color: #f4f4f4;
74+
border-radius: 5px;
75+
list-style: none;
76+
font-weight: bold;
77+
summary:hover {
78+
background-color: #e0e0e0;
79+
}
80+
81+
summary:focus-visible {
82+
outline: 2px solid var(--color);
83+
outline-offset: 2px;
84+
}
85+
}
86+
87+
details {
88+
margin-top: 10px;
89+
padding: 10px;
90+
border: 1px solid #ddd;
91+
border-radius: 5px;
92+
}

0 commit comments

Comments
 (0)