Skip to content

Commit 499baa4

Browse files
author
Bee Kay
committed
refactor: massively overhauled scss removing repetitive code and adding flexbox functionality for responsive design
1 parent baf80af commit 499baa4

File tree

1 file changed

+48
-147
lines changed

1 file changed

+48
-147
lines changed

scss/components/_media-queries.scss

Lines changed: 48 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,77 @@
11
/* ============================================ */
22
/* Media Queries */
33
/* ============================================ */
4+
$breakpoint-tablet: 768px;
5+
$breakpoint-desktop: 1024px;
46

57
$portfolio-bg: #fff;
8+
$main-text: #fff;
69

7-
/* Note: Hide Footer Nav on Mobile - only display "back to top" */
10+
//*TABLET BREAKPOINT*//
811

9-
@media (min-width: 768px) {
12+
@media (min-width: $breakpoint-tablet) {
1013

1114
ul{
1215
margin: auto;
1316
text-align: center;
1417
}
1518

1619
li {
17-
display: inline-block;
1820
background: none;
19-
}
20-
21-
.intro-img {
22-
margin: 0 20px 20px 0;
23-
float: right;
24-
max-width: 30%;
25-
padding: 20px;
26-
border-radius: 50%;
2721
}
2822

2923
.name {
30-
margin-top: 20px;
31-
clear: both;
32-
padding: 20px;
33-
24+
padding: 20px;
25+
}
26+
27+
.main-header{
28+
flex-direction: column;
29+
}
30+
31+
.main-nav ul {
32+
flex-direction: row;
33+
justify-content: center;
3434
}
35-
.main-nav {
36-
width: 100%;
35+
36+
.intro-img {
37+
margin: 20px;
38+
max-width: 33.33%;
39+
padding: 20px;
40+
border-radius: 50%;
3741
}
3842

3943
.intro {
40-
display: block;
41-
float: left;
42-
font-size: 1.4em;
43-
font-weight: lighter;
44-
letter-spacing: .1em;
45-
line-height: 1.5em;
46-
margin: 20px 0 0 20px;
47-
width: 60%;
48-
text-align: left;
49-
44+
flex-direction: row-reverse;
45+
align-items: center;
5046
}
5147

5248
.portfolio {
53-
display: block;
54-
background-color: $portfolio-bg;
55-
clear: both;
49+
flex-direction: row;
50+
flex-wrap: wrap;
5651
}
57-
58-
.portfolio-img {
59-
display: block;
60-
margin: auto;
61-
62-
}
6352

6453
.col {
65-
float: left;
66-
width: calc(50% - 5px);
67-
margin-bottom: 0;
54+
width: 50%;
55+
}
56+
57+
.skills ul {
58+
flex-direction: row;
6859
}
6960

7061
.contact {
62+
margin: 20px 0;
63+
padding: 20px;
7164
text-align: center;
7265
}
7366

74-
.footer-name {
75-
display: block;
76-
margin: 10px 0;
77-
float: left;
78-
79-
}
8067
.footer-nav {
81-
display: block;
82-
}
83-
84-
.footer-nav ul {
85-
float: right;
86-
}
87-
88-
.footer-nav li {
89-
padding: 15px;
90-
margin: 5px;
68+
display: flex;
69+
70+
li {
71+
padding: 15px;
72+
margin: 5px;
73+
}
9174
}
92-
9375

9476
.top {
9577
display: none;
@@ -98,108 +80,27 @@ $portfolio-bg: #fff;
9880

9981
}
10082

101-
@media (min-width: 1024px) {
102-
10383

104-
ul{
105-
margin: auto;
106-
text-align: right;
107-
padding: 0 10px 20px 0;
108-
109-
}
84+
//*DESKTOP BREAKPOINT*//
11085

111-
li {
112-
display: inline-block;
113-
background: none;
86+
@media (min-width: $breakpoint-desktop) {
11487

115-
}
116-
117-
.intro-img {
118-
float: right;
119-
margin: 0 20px 45px 0;
120-
border-radius: 50%;
121-
}
12288

123-
.name {
124-
display: block;
125-
margin: auto;
126-
float: left;
127-
128-
}
129-
.main-nav ul{
130-
width: 100%;
131-
margin: auto;
132-
display: block;
89+
.main-header {
90+
flex-direction: row;
91+
align-items: center;
92+
justify-content: space-between;
13393
}
13494

13595
.intro {
136-
display: block;
137-
text-align: left;
138-
font-size: 1.4em;
139-
font-weight: lighter;
140-
letter-spacing: .1em;
141-
line-height: 1.5em;
142-
margin: 20px 20px;
143-
padding: 50px;
144-
width: 60%;
145-
96+
font-size: 1.1em;
14697
}
14798

14899
.portfolio {
149-
display: block;
150-
background-color: $portfolio-bg;
151-
clear: both;
152-
border-radius: 5%;
100+
border-radius: 7%;
153101
}
154-
155-
.portfolio-img {
156-
max-width: 100%;
157-
display: block;
158-
margin: auto;
159-
}
160102

161103
.col {
162-
width: calc(33.333%);
104+
width: 33.33%;
163105
}
164-
165-
166-
.skills ul {
167-
text-align: center;
168-
169-
}
170-
.contact {
171-
text-align: center;
172-
}
173-
174-
.footer-name {
175-
display: block;
176-
margin: 15px 0;
177-
float: left;
178-
179-
}
180-
.footer-nav {
181-
display: block;
182-
}
183-
184-
.footer-nav ul {
185-
float: right;
186-
}
187-
188-
.footer-nav li {
189-
padding: 15px;
190-
margin: 5px;
191-
}
192-
193-
.top {
194-
display: none;
195-
}
196-
197-
}
198-
199-
200-
/*Float Clearfix-------------------------------*/
201-
.clearfix:after {
202-
content: "";
203-
display: table;
204-
clear: both;
205-
}
106+
}

0 commit comments

Comments
 (0)