1
0
mirror of https://github.com/GenderDysphoria/GenderDysphoria.fyi.git synced 2025-11-25 20:42:40 +00:00
Files
GenderDysphoria.fyi/scss/_header.scss
Dex 26aba42e2f Dark Mode (#168)
* Implement toggle button

* Dark mode mixins

* Dark mode color design

* Disable dark mode for prints

* Initial dark mode design

* Fix light mode mixin

* Disable dark mode on print style

* Move dark mode color scheme below the default style to allow referencing

* Fix dropdown

* Fix device-based dark mode

* Dark mode index page design

* Responsive auxiliary nav with dark mode toggle

* Remove box shadow when on smaller displays

* Prevent default on toggle click

* Move attribution/licensing to README.md

* Fix header padding on index page

* Background color transition animation

* Remove margin on index when on mobile displays

* Remove neon border when on mobile

* Fix post-header margin on mobile

* Lighten card headers in dark mode
2025-06-09 02:26:27 +00:00

274 lines
4.3 KiB
SCSS

@mixin header--active {
min-height: 0;
color: #555;
background: #fff;
box-shadow: 1px 2px 10px rgba(0, 0, 0, 0.3);
a {
&:hover, &:focus {
text-decoration: none;
}
}
@include dark-mode {
color: $body-color-dark;
}
}
body.inner-page header {
@include header--active;
}
header {
color: white;
padding: 0 3rem;
position: fixed;
top: -1px;
left: -1px;
right: -1px;
z-index: 100;
@media (max-width: 500px) {
padding: 0.5rem 1rem 0;
// position: static;
}
transition-property: min-height, background, box-shadow;
transition-duration: 0.4s;
background: none;
// width: 100%;
min-height: 100px;
display: flex;
align-items: center;
justify-content: center;
a {
color: inherit;
// transition: none;
&:hover, &:focus {
color: inherit;
text-decoration: none;
}
}
.top-brand {
text-align: center;
color: inherit;
font-family: $font-brand;
font-size: 2em;
white-space: nowrap;
transition: max-height 0.5s ease-out;
overflow: hidden;
@media (max-width: 500px) {
font-size: 1.8em;
}
@include dark-mode {
abbr {
color: $primary;
}
}
}
&.active {
@include header--active;
@media (max-width: 500px) {
.top-brand {
max-height: 0;
}
.top-nav.aux-nav {
display: none;
}
}
}
nav {
flex: 1;
display: flex;
justify-content: space-between;
align-items: center;
@media (max-width: 800px) {
flex-direction: column;
// align-items: stretch; // uncomment after menu items are added back
}
@media (max-width: 500px) {
font-size: 0.8rem;
}
@include dark-mode {
a {
color: inherit;
&:hover {
color: inherit;
text-decoration: none;
}
}
}
}
.top-nav {
&.main-nav {
margin-left: auto;
order: 2;
@media (max-width: 800px) {
margin-left: 0;
}
}
&.aux-nav {
order: 3;
@media (max-width: 800px) {
order: 1;
}
}
}
.top-nav-inner {
display: flex;
justify-content: space-between;
align-items: center;
list-style: none;
margin: 0;
padding: 0;
.top-nav-item {
transition-property: color, padding, margin;
transition-duration: 0.3s;
transition-timing-function: ease;
display: block;
padding: 0.5rem 1rem;
text-align: center;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
white-space: nowrap;
display: flex;
align-items: center;
&:hover {
border-bottom: 5px solid $primary;
}
}
.break {
flex-basis: 100%;
display: none;
}
@media (max-width: 1000px) {
.top-nav-item {
padding: 0.5rem 0.5rem;
}
}
@media (max-width: 800px) {
.top-nav-item {
border-top: none;
}
}
.dropdown-menu {
max-height: 90vh;
overflow: auto;
}
.dark-toggle {
display: grid;
> span {
grid-column: 1;
grid-row: 1;
transition: all 0.5s;
transition-behavior: allow-discrete;
}
.dark-toggle-sun {
opacity: 1;
}
.dark-toggle-moon {
opacity: 0;
}
@include dark-mode {
.dark-toggle-sun {
opacity: 0;
}
.dark-toggle-moon {
opacity: 1;
}
}
}
}
}
body:not(.front-page) header + * {
margin-top: $header-mobile-height;
@media (min-width: 800px) {
margin-top: $header-desktop-height;
}
}
.disclaimer {
$cwColor: darken($gray-100, 2%);
border-bottom: 1px solid $gutter-border;
> div {
margin: 0 auto;
max-width: 1200px;
padding: 10px 1em;
@media (max-width: 500px) {
padding: 10px 1em;
}
}
background-color: $cwColor;
@include dark-mode {
background-color: $gray-800;
color: white;
border-bottom: 1px solid $primary;
}
font-size: 0.8rem;
font-weight: 300;
.container {
max-width: 600px;
}
.strong {
display: block;
font-weight: 600;
margin: 5px -10px;
padding: 0px 10px 5px;
font-size: 1.2rem;
font-family: $font-secondary;
p { margin: 0; }
}
p:last-child {
margin-bottom: 0;
}
}