Skip to content

Commit 52f6dc8

Browse files
author
Angus Chang
committed
refactor: spacing and layout WIP
- Created mixin for section padding - Added mixin to every section except ApprenticeQualities - Refactored PreviousApprenticeGroups to align to have all groups align to the left - Refactored font sizes in the hero - Refactored PreviousApprenticeGroup to make sure triangle svg does not wrap - Moved visually hidden mixin from hero sass module to mixin partials file FSA21V2-156
1 parent 98d4a3e commit 52f6dc8

6 files changed

Lines changed: 61 additions & 53 deletions

File tree

components/call-to-action/call-to-action.module.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
@use '../../styles/colors' as *;
22
@use '../../styles/spacing' as *;
3+
@use '../../styles/mixins' as *;
34

45
.call-to-action {
6+
@include section-padding();
57
width: $component-width;
68
display: flex;
79
align-items: center;
810
flex-direction: column;
9-
padding: 1rem;
1011
box-sizing: border-box;
1112
background: radial-gradient(110% 110% at 15.71% 0%, $background-color 85%, #0b1618 100%);
1213

components/current-apprentices/current-apprentices.module.scss

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
@use '../../styles/colors' as *;
22
@use '../../styles/spacing' as *;
33
@use '../../styles/fonts';
4+
@use '../../styles/mixins' as *;
45

56
.current-apprentices {
7+
@include section-padding();
8+
box-sizing: border-box;
69
width: $component-width;
710
display: flex;
811
flex-direction: column;
@@ -11,13 +14,10 @@
1114
&__content {
1215
width: 100%;
1316
max-width: $max-content-width;
14-
box-sizing: border-box;
15-
padding: 1rem;
1617
}
1718

1819
&__header {
1920
text-align: center;
20-
padding: 1rem;
2121

2222
h2 {
2323
font-size: 2rem;
@@ -36,11 +36,13 @@
3636
align-items: center;
3737

3838
&__card {
39+
margin-right: 2rem;
40+
3941
img {
4042
display: none;
4143
}
44+
4245
width: 18rem;
43-
padding: 1rem;
4446
}
4547

4648
@supports (display: grid) {
@@ -52,11 +54,7 @@
5254
}
5355
}
5456

55-
@media (min-width: 45rem) {
56-
&__content {
57-
padding: 5rem 2rem;
58-
}
59-
57+
@media (min-width: 47.9rem) {
6058
&__header {
6159
text-align: left;
6260
}
@@ -67,10 +65,4 @@
6765
flex-wrap: wrap;
6866
}
6967
}
70-
71-
@media (min-width: 70rem) {
72-
&__content {
73-
padding: 4rem 0;
74-
}
75-
}
7668
}

components/hero/hero.module.scss

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,10 @@
11
@use '../../styles/colors' as *;
22
@use '../../styles/spacing' as *;
3-
4-
@mixin visually-hidden {
5-
position: fixed;
6-
right: 100%;
7-
bottom: 100%;
8-
clip: rect(1px, 1px, 1px, 1px);
9-
clip-path: inset(50%);
10-
11-
&:focus {
12-
left: 0;
13-
right: auto;
14-
top: 0;
15-
bottom: auto;
16-
clip: auto;
17-
clip-path: none;
18-
}
19-
}
3+
@use '../../styles/mixins' as *;
204

215
.hero {
226
width: $component-width;
23-
// The line below needs should be reviewed by another developer or designer (min height or no min height?):
7+
// The line below needs should be reviewed by another developer or designer (should hero be 100vh?)):
248
// min-height: 100vh;
259
display: flex;
2610
justify-content: center;
@@ -38,8 +22,8 @@
3822
}
3923

4024
&__container {
25+
@include section-padding();
4126
max-width: $max-content-width;
42-
padding: 1rem;
4327
display: flex;
4428
flex-direction: column;
4529
}
@@ -54,6 +38,10 @@
5438
flex-direction: column;
5539
order: 1;
5640

41+
h1 {
42+
font-size: 3rem;
43+
}
44+
5745
h1,
5846
p {
5947
padding-bottom: 1rem;
@@ -199,7 +187,7 @@
199187

200188
h1 {
201189
width: 60%;
202-
font-size: 4rem;
190+
font-size: 3.4rem;
203191
}
204192

205193
p {
@@ -221,7 +209,6 @@
221209
}
222210

223211
@media (min-width: 70.25rem) {
224-
padding: 5rem;
225212
box-sizing: border-box;
226213

227214
&__sparkbox-logo {
@@ -241,7 +228,7 @@
241228
margin-top: 2rem;
242229

243230
h1 {
244-
font-size: 5rem;
231+
font-size: 4.5rem;
245232
width: 100%;
246233
}
247234

components/previous-apprentices-group/previous-apprentices-group.module.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
}
1717

1818
&__apprentice {
19+
width: 10rem;
20+
1921
&:not(&:last-child) {
2022
padding-bottom: 0.5rem;
2123
}
@@ -24,6 +26,6 @@
2426

2527
@media (min-width: 45rem) {
2628
.previous-apprentices-group {
27-
flex-basis: 20%;
29+
flex-basis: 17%;
2830
}
2931
}

components/previous-apprentices/previous-apprentices.module.scss

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
@use '../../styles/colors' as *;
22
@use '../../styles/spacing' as *;
33
@use '../../styles/fonts' as *;
4+
@use '../../styles/mixins' as *;
45

56
.previous-apprentices {
7+
@include section-padding();
8+
box-sizing: border-box;
69
width: $component-width;
710

811
&__header {
@@ -14,29 +17,25 @@
1417
p {
1518
display: inline-block;
1619
}
17-
18-
h2 {
19-
margin: 0 6rem;
20-
}
2120
}
2221

2322
&__legend {
2423
padding-top: 0.5rem;
2524
margin-right: 2.5rem;
2625

2726
p {
28-
padding-left: 1rem;
27+
margin-right: 2rem;
2928
}
3029

31-
svg {
32-
padding-left: 4rem;
30+
svg:nth-child(1) {
31+
margin-right: 0.5rem;
3332
}
3433
}
3534

3635
&__groups {
3736
display: flex;
38-
justify-content: center;
39-
column-gap: 1rem;
37+
justify-content: flex-start;
38+
column-gap: 3rem;
4039
row-gap: 2rem;
4140
flex-flow: row wrap;
4241
max-width: $max-content-width;
@@ -46,7 +45,6 @@
4645

4746
.employee-status {
4847
width: 0.75rem;
49-
padding-left: 0.5rem;
5048
fill: black;
5149
}
5250

@@ -65,10 +63,6 @@
6563
.previous-apprentices {
6664
&__header {
6765
margin: auto;
68-
69-
h2 {
70-
margin: 0 4rem;
71-
}
7266
}
7367

7468
&__groups {

styles/_mixins.scss

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
@mixin section-padding {
2+
padding: 9%;
3+
4+
@media (min-width: 768px) {
5+
padding: 3.75rem;
6+
}
7+
8+
@media (min-width: 992px) {
9+
padding: 6rem;
10+
}
11+
12+
@media (min-width: 1200px) {
13+
padding: 8rem;
14+
}
15+
}
16+
17+
@mixin visually-hidden {
18+
position: fixed;
19+
right: 100%;
20+
bottom: 100%;
21+
clip: rect(1px, 1px, 1px, 1px);
22+
clip-path: inset(50%);
23+
24+
&:focus {
25+
left: 0;
26+
right: auto;
27+
top: 0;
28+
bottom: auto;
29+
clip: auto;
30+
clip-path: none;
31+
}
32+
}

0 commit comments

Comments
 (0)