Skip to content

Commit f276f16

Browse files
authored
CSS/design Improvements (#51)
* center nav * move span to nest under .nav-link The span hover rules were under .nav-link already, and <span> is inside .nav-link, so it makes more sense to nest it under .nav-link. * make nav link background color full width on mobile * don't change margin/padding of nav links on mobile Hover effects are barely seen on mobile anyway, and it makes the mobile nav menu look weird. * make desktop nav fill the screen * right-align cta buttons in footer on desktop Looks a little nicer.
1 parent 1590df3 commit f276f16

2 files changed

Lines changed: 26 additions & 17 deletions

File tree

src/lib/components/Footer.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,11 @@
8383
}
8484
8585
.ctas {
86+
text-align: right;
87+
8688
> :global(*) {
8789
margin-bottom: 1em;
8890
}
8991
}
9092
91-
</style>
93+
</style>

src/lib/components/Header.svelte

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,10 @@
121121
.nav {
122122
--nav-border: solid 1px var(--color-nav-border);
123123
124-
display: block;
125-
position: relative;
126124
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
127125
128126
@media screen and (width >= 1024px) {
129-
padding: 0.5em 2em;
127+
padding: 0.5em 0;
130128
}
131129
}
132130
@@ -159,20 +157,14 @@
159157
}
160158
161159
@media screen and (width >= 1024px) {
162-
display: inline-block;
160+
display: flex;
161+
justify-content: center;
162+
width: 100%;
163163
padding: 0;
164164
position: unset;
165165
background: unset;
166166
border: none;
167167
}
168-
169-
span {
170-
display: inline-block;
171-
padding: 0.5em 1em;
172-
margin: 0 1em;
173-
174-
transition: margin 200ms, padding 200ms;
175-
}
176168
}
177169
178170
.nav-link {
@@ -182,19 +174,34 @@
182174
text-decoration: none;
183175
184176
@media screen and (width >= 1024px) {
177+
flex-grow: 1;
178+
text-align: center;
185179
border-right: var(--nav-border);
186180
187-
&:first-child {
188-
border-left: var(--nav-border);
181+
&:last-child {
182+
border-right: none;
183+
}
184+
}
185+
186+
span {
187+
display: block;
188+
padding: 0.5em 1em;
189+
margin: 0 1em;
190+
191+
@media screen and (width >= 1024px) {
192+
transition: margin 200ms, padding 200ms;
189193
}
190194
}
191195
192196
&:hover span {
193-
padding: 0.5em 2em;
194-
margin: 0;
195197
text-shadow: 0 0 1px var(--color-nav-text);
196198
197199
background-color: var(--color-nav-background);
200+
201+
@media screen and (width >= 1024px) {
202+
padding: 0.5em 2em;
203+
margin: 0;
204+
}
198205
}
199206
200207
&.active span {

0 commit comments

Comments
 (0)