Skip to content

Commit 3bbd7ab

Browse files
committed
added css for wireframe task
1 parent 989fa20 commit 3bbd7ab

2 files changed

Lines changed: 88 additions & 19 deletions

File tree

Wireframe/index.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,33 @@ <h1>Planning Your Codebase</h1>
1616
<main>
1717
<section>
1818
<article>
19+
<img
20+
src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSdd25hyNQOMs4Xx1Cv_A_oaT0zagfSWlXMBA&s"
21+
alt="Official Git logo"
22+
/>
23+
<hr />
1924
<h2>What is Git?</h2>
2025
<p>[summary goes here]</p>
2126
<a href="#">Read more</a>
2227
</article>
2328

2429
<article>
30+
<img
31+
src="https://tangenttechnologies.ca/media/1240/git-github.png?width=800"
32+
alt="Developers collaborating with laptops"
33+
/>
34+
<hr />
2535
<h2>Why Do Developers Use Git?</h2>
2636
<p>[summary goes here]</p>
2737
<a href="#">Read more</a>
2838
</article>
2939

3040
<article>
41+
<img
42+
src="https://i0.wp.com/digitalvarys.com/wp-content/uploads/2019/06/GIT-Branchand-its-Operations.png?fit=1921%2C1057&ssl=1"
43+
alt="Visual explanation of branching in Git"
44+
/>
45+
<hr />
3146
<h2>What is a Branch in Git?</h2>
3247
<p>[summary goes here]</p>
3348
<a href="#">Read more</a>

Wireframe/style.css

Lines changed: 73 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ As well as useful links to learn more */
99
It sets out the colours, fonts, styles etc to be used in this design
1010
At work, a designer will give these to you based on the corporate brand, but while you are learning
1111
You can design it yourself if you like
12+
1213
Inspect the starter design with Devtools
14+
1315
Click on the colour swatches to see what is happening
16+
1417
I've put some useful CSS you won't have learned yet
1518
For you to explore and play with if you are interested
1619
https://web.dev/articles/min-max-clamp
@@ -41,34 +44,60 @@ svg {
4144
width: 100%;
4245
object-fit: cover;
4346
}
47+
48+
/* ====== Header Layout ====== */
49+
header {
50+
padding: var(--space);
51+
text-align: center;
52+
}
53+
header h1 {
54+
font-size: 2rem;
55+
margin-bottom: var(--space);
56+
}
57+
header p {
58+
font-size: 1.2rem;
59+
color: gray;
60+
}
61+
4462
/* ====== Site Layout ======
4563
Setting the overall rules for page regions
4664
https://www.w3.org/WAI/tutorials/page-structure/regions/
4765
*/
4866
main {
4967
max-width: var(--container);
50-
margin: 0 auto calc(var(--space) * 4) auto;
68+
margin: 0 auto calc(var(--space) * 6) auto;
69+
padding-bottom: calc(var(--space) * 4);
5170
}
52-
footer {
53-
position: fixed;
54-
bottom: 0;
55-
text-align: center;
56-
}
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-
*/
64-
main {
71+
72+
/* ====== Articles Grid Layout ====
73+
Setting the rules for how articles are placed in the main element.
74+
Inspect this in Devtools and click the "grid" button in the Elements view
75+
Play with the options that come up.
76+
https://developer.chrome.com/docs/devtools/css/grid
77+
https://gridbyexample.com/learn/
78+
*/
79+
section {
6580
display: grid;
6681
grid-template-columns: 1fr 1fr;
6782
gap: var(--space);
68-
> *:first-child {
83+
}
84+
85+
section > article:first-child {
6986
grid-column: span 2;
7087
}
88+
89+
90+
/* added padding, width and border top to the footer*/
91+
footer {
92+
position: fixed;
93+
bottom: 0;
94+
text-align: center;
95+
width: 100%;
96+
padding: var(--space);
97+
border-top: var(--line);
98+
background-color: var(--paper);
7199
}
100+
72101
/* ====== Article Layout ======
73102
Setting the rules for how elements are placed in the article.
74103
Now laying out just the INSIDE of the repeated card/article design.
@@ -80,10 +109,35 @@ article {
80109
text-align: left;
81110
display: grid;
82111
grid-template-columns: var(--space) 1fr var(--space);
83-
> * {
112+
grid-template-rows: auto auto auto auto;
113+
margin-bottom: calc(var(--space) * 2);
114+
border-radius: 6px;
115+
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
116+
}
117+
118+
article > * {
84119
grid-column: 2/3;
85120
}
86-
> img {
87-
grid-column: span 3;
88-
}
121+
122+
/* Force consistent image height */
123+
article > img {
124+
aspect-ratio: 2 / 1;
125+
height: auto;
126+
width: 100%;
127+
object-fit: contain;
128+
display: block;
129+
background-color: white;
130+
box-sizing: border-box;
131+
margin-bottom: 0; /* no extra space */
132+
border-bottom: 1px solid var(--ink); /* 🪄 this is the key fix */
133+
}
134+
135+
/* Make the <hr> look like your wireframe divider */
136+
article hr {
137+
grid-column: 2 / 3;
138+
border: none;
139+
height: 1px;
140+
background-color: var(--ink);
141+
opacity: 0.4;
142+
margin: calc(var(--space) * 1.5) 0;
89143
}

0 commit comments

Comments
 (0)