1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-27 15:16:21 -04:00

fix responsive header

This commit is contained in:
Jake Jarvis 2021-09-29 10:02:24 -04:00
parent 12db17b83c
commit 2b918ea027
Signed by: jake
GPG Key ID: 2B0C9CF251E69A39
2 changed files with 34 additions and 31 deletions

View File

@ -53,7 +53,7 @@ header {
ul { ul {
list-style: none; list-style: none;
display: flex; display: flex;
align-items: center; align-items: baseline;
margin: 0; margin: 0;
padding: 0; padding: 0;
@ -90,16 +90,11 @@ header {
} }
} }
// no margin on the first child to make more room on narrow windows (before responsiveness kicks in).
// last child is the dark mode toggle -- margin is set directly on it in case it's hidden (if JS is disabled).
&:first-child,
&:last-child {
margin-left: 0;
}
}
// Dark mode toggle // Dark mode toggle
button.dark-mode-toggle { &#header-lightbulb {
align-self: center;
button {
// native button reset // native button reset
border: 0; border: 0;
padding: 0; padding: 0;
@ -117,6 +112,15 @@ header {
cursor: pointer; cursor: pointer;
} }
} }
// no margin on the first child to make more room on narrow windows (before responsiveness kicks in).
// last child is the dark mode toggle -- margin is set directly on it in case it's hidden (if JS is disabled).
&:first-child,
&:last-child {
margin-left: 0;
}
}
}
} }
} }
@ -143,7 +147,7 @@ header {
} }
} }
ul.header-menu { ul {
font-size: 1.6em; font-size: 1.6em;
li { li {
@ -164,14 +168,12 @@ header {
transform: none; transform: none;
} }
} }
}
// Dark mode toggle // Dark mode toggle
button.dark-mode-toggle { &#header-lightbulb button.dark-mode-toggle {
// TODO: figure out need for weird magic numbers here // TODO: figure out need for weird magic numbers here
height: 1.08em; // ~27px, don't ask height: 1.08em; // ~27px, don't ask
width: 1.08em; width: 1.08em;
margin-top: 0.15em;
margin-left: 1em; margin-left: 1em;
margin-right: -0.2em; // weirdness w/ svg ratio margin-right: -0.2em; // weirdness w/ svg ratio
} }
@ -179,3 +181,4 @@ header {
} }
} }
} }
}

View File

@ -16,7 +16,7 @@
</a> </a>
</li> </li>
{{- end }} {{- end }}
<li> <li id="header-lightbulb">
<button class="dark-mode-toggle" title="Toggle Dark Mode" aria-label="Toggle Dark Mode" style="display: none;"></button> <button class="dark-mode-toggle" title="Toggle Dark Mode" aria-label="Toggle Dark Mode" style="display: none;"></button>
</li> </li>
</ul> </ul>