Skip to content

Commit f7d7b2c

Browse files
committed
Responsive resizing
1 parent e3c7afb commit f7d7b2c

3 files changed

Lines changed: 40 additions & 42 deletions

File tree

_sass/intro.scss

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@
99
}
1010

1111
#intro-headshot-wrapper {
12-
/* Prevent shrinking and set its basis explicitly */
1312
flex: 0 0 200px; // shorthand for: flex-grow:0; flex-shrink:0; flex-basis:260px
14-
/* optional: enforce a floor just in case */
15-
// min-width: 200px;
16-
// width: 200px;
1713
}
1814

1915
#intro-text-wrapper {
@@ -89,16 +85,18 @@
8985
margin-bottom: calc(3 * $spacing);
9086
text-align: center;
9187
font-family: $title-font;
92-
font-size: $tag-font-size;
88+
font-size: var(--tag-font-size)
9389
// text-transform: uppercase;
9490
}
9591

96-
@media only screen and (max-width: 650px) {
92+
@media only screen and (max-width: $screen-width-threshold) {
9793

9894
#intro {
9995
display: flex;
10096
flex-wrap: wrap;
10197
gap: calc(3 * $spacing);
98+
margin-top: calc(6 * $spacing);
99+
justify-content: center;
102100
}
103101

104102
.intro-links {
@@ -109,31 +107,31 @@
109107
display: contents;
110108
}
111109

112-
// #intro-headshot-wrapper {
113-
// max-width: none;
114-
// }
115-
116110
#intro-headshot {
117111
order: 1;
118-
flex: 0 0 auto;
119-
min-width: 50px;
120-
width: 66px;
121-
// height: 66px;
112+
flex: 1 1 0;
113+
min-width: 80px;
114+
max-width: 80px;
122115
}
123116

124117
#intro-header {
125118
order: 2;
126-
flex: 1 1 0;
127-
min-width: 0;
119+
flex: 1 1 240px;
120+
min-width: 240px;
121+
// white-space: nowrap;
128122
}
129123

130124
#job-market {
131-
order: 4;
125+
order: 3;
132126
flex: 0 0 100%;
133127
}
134128

129+
#job-market p {
130+
text-align: left;
131+
}
132+
135133
#intro-text {
136-
order: 3;
134+
order: 4;
137135
flex: 0 0 100%;
138136
}
139137

_sass/main.scss

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11

22
body {
3+
min-width: 380px;
4+
35
}
46

57
header {
68
border-bottom: 1px solid #e8e8e8d3;
79
box-shadow: 0px 1px 2px #e8e8e8d3;
10+
min-width: 400px;
11+
width: 100%;
812
}
913

1014
#main {
@@ -109,7 +113,7 @@ img {
109113
}
110114

111115
#site-header {
112-
width: 100vw;
116+
// width: 100vw;
113117
display: flex;
114118
justify-content: center;
115119
position: fixed;
@@ -119,8 +123,8 @@ img {
119123
}
120124

121125
#site-header-content {
122-
width: var(--max-width);
123-
padding: calc(2 * $spacing) calc(4 * $spacing);
126+
width: 90%;
127+
margin: calc(2 * $spacing) calc(4 * $spacing);
124128
display: grid;
125129
grid-template-columns: auto auto;
126130
align-items: center;

assets/css/styles.scss

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,13 @@ $link-color-light: #eff5ff;
4040
$link-color-hover: #e7eef9;
4141
$award-color: #E7B100;
4242

43+
$screen-width-threshold: 710px;
44+
4345

4446
html {
4547
--title-font-size: 32pt;
4648
--heading-font-size: 16pt;
49+
--tag-font-size: 14pt;
4750
--body-font-size: 12pt;
4851
--accent-font-size: 11pt;
4952
--max-width: 950px;
@@ -58,19 +61,29 @@ html {
5861

5962

6063
/* Mobile Styles */
61-
@media only screen and (max-width: 650px) {
64+
@media only screen and (max-width: $screen-width-threshold) {
6265

6366
html {
6467
--title-font-size: 20pt;
6568
--subtitle-font-size: 14pt;
66-
--heading-font-size: 12pt;
67-
--body-font-size: 12pt;
69+
--heading-font-size: 11pt;
70+
--body-font-size: 11pt;
6871
--accent-font-size: 10pt;
72+
--tag-font-size: 13pt;
73+
--subbody-font-size: 11pt;
74+
}
75+
76+
#main {
77+
margin-left: calc(4 * $spacing);
78+
margin-right: calc(4 * $spacing);
6979
}
7080

7181
body {
72-
margin: 2em;
82+
// margin: 2em;
7383
}
84+
}
85+
86+
@media only screen and (max-width: 500px) {
7487

7588
.publication {
7689
flex-direction: column;
@@ -96,21 +109,4 @@ html {
96109
width: 100%;
97110
height: auto;
98111
}
99-
100-
// #intro-description {
101-
// flex-direction: column-reverse;
102-
// }
103-
104-
// #intro-headshot-wrapper {
105-
// max-width: 100px;
106-
// margin-bottom: calc(3 * $spacing);
107-
// }
108-
109-
// #intro, #intro-description {
110-
// align-items: center;
111-
// }
112-
113-
// .news {
114-
// grid-template-columns: 110px auto;
115-
// }
116112
}

0 commit comments

Comments
 (0)