@header-image-px: 60px; @header-link-margin: 14px; @header-icon-px: 40px; .header { --header-image-px: @header-image-px; --header-link-margin: @header-link-margin; --header-background-mask-image: linear-gradient(180deg, @background-colour 0, transparent 100%); --header-background-mask-image: linear-gradient(180deg, var(--background-colour) 0, transparent 100%); flex: 0 0 auto; &__background { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: @background-pattern; background-color: @header-accent-colour; background: var(--background-pattern); background-color: var(--header-accent-colour); background-blend-mode: multiply; mask-image: var(--header-background-mask-image); -webkit-mask-image: var(--header-background-mask-image); // fuck chrome } &__desktop { margin: 0 auto; display: flex; align-items: flex-start; padding: 4px; max-width: @site-max-width; height: @header-height-desktop; max-width: var(--site-max-width); height: var(--header-height-desktop); @media (max-width: @site-mobile-width) { display: none; } &__logo { flex: 0 0 auto; color: inherit; text-decoration: none; cursor: pointer; display: block; background: no-repeat center / cover; background-image: @site-logo; width: @header-image-px; height: @header-image-px; background-image: var(--site-logo); width: var(--header-image-px); height: var(--header-image-px); font-size: 0; transition: width .1s, height .1s; } &__menus { display: flex; flex: 0 0 auto; height: 100%; } &__link { color: inherit; text-decoration: none; display: block; min-width: 100px; cursor: pointer; border-radius: 2px; padding: 4px 10px; transition: background-color .2s; &:hover, &:focus { background-color: fade(#fff, 20%); } &:active { background-color: fade(#fff, 10%); } } &__menu { margin: 0 5px; &__link { margin: @header-link-margin 0; margin: var(--header-link-margin) 0; font-size: 1.2em; padding: 6px 10px; text-align: center; } } &__submenu { position: absolute; z-index: 100; overflow: hidden; max-height: 0; transition: max-height .2s; left: -5px; top: 50px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); &__link { margin: 5px; } &__background { background: @header-accent-colour; background: var(--header-accent-colour); position: absolute; top: 0; left: 0; right: 0; bottom: 0; } &__content { background: @background-colour-translucent-9; background: var(--background-colour-translucent-9); overflow: hidden; } } &__menu:hover &__submenu, &__menu:focus &__submenu, &__menu:focus-within &__submenu, &__menu:active &__submenu { max-height: 200px; } &__user { flex: 0 0 auto; display: flex; align-items: center; margin-left: auto; &__avatar { width: @header-image-px; height: @header-image-px; width: var(--header-image-px); height: var(--header-image-px); margin-left: 5px; transition: width .1s, height .1s; box-shadow: 0 0 4px #111; &:hover, &:focus, &:active { box-shadow: inset 0 0 0 1px @user-colour, 0 0 4px #111; box-shadow: inset 0 0 0 1px var(--user-colour), 0 0 4px #111; } } &__button { margin: 2px; color: inherit; text-decoration: none; font-size: 1.5em; line-height: 32px; width: 32px; height: 32px; transition: background-color .2s; border-radius: 4px; text-align: center; &:hover, &:focus { background-color: fade(#fff, 20%); } &:active { background-color: fade(#fff, 10%); } &__count { position: absolute; bottom: 1px; right: 1px; font-size: 10px; background-color: @header-accent-colour; background-color: var(--header-accent-colour); opacity: .9; border-radius: 4px; line-height: 12px; padding: 2px 4px; } } } } &__mobile { --header-icon-px: @header-icon-px; display: block; @media (min-width: @site-mobile-width) { display: none; } &__icons { display: flex; justify-content: space-between; height: @header-height-mobile; height: var(--header-height-mobile); padding: 5px; z-index: 100; -webkit-touch-callout: none !important; -webkit-user-select: none !important; -khtml-user-select: none !important; -moz-user-select: none !important; -ms-user-select: none !important; user-select: none !important; } &__icon { flex: 0 0 auto; cursor: pointer; font-size: 32px; width: @header-icon-px; height: @header-icon-px; width: var(--header-icon-px); height: var(--header-icon-px); display: flex; justify-content: center; align-items: center; -webkit-touch-callout: none !important; -webkit-user-select: none !important; -khtml-user-select: none !important; -moz-user-select: none !important; -ms-user-select: none !important; user-select: none !important; } &__logo { color: inherit; text-decoration: none; background: no-repeat center / cover; background-image: @site-logo; background-image: var(--site-logo); font-size: 0; } &__avatar { transition: box-shadow .2s; box-shadow: 0 0 4px #111; } &__toggle { display: none; } &__menu { position: absolute; top: 0; left: 0; right: 0; z-index: 99; background: @background-pattern; background-color: @header-accent-colour; background: var(--background-pattern); background-color: var(--header-accent-colour); background-blend-mode: multiply; transition: max-height .2s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); text-shadow: 0 1px 4px #000; max-height: 0; overflow: hidden; &__spacer { height: @header-height-mobile; height: var(--header-height-mobile); } } &__toggle:checked ~ &__menu { max-height: 600px; } &__user { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid #fff; padding: 5px 5px 3px; // extra 2px is provided by the buttons } &__navigation { padding: 5px; } &__link { color: inherit; text-decoration: none; display: block; padding: 8px; padding-left: 20px; cursor: pointer; border-radius: 2px; transition: background-color .2s, margin .1s, opacity .1s; font-size: 1.2em; &:not(:last-child) { margin-bottom: 2px; } &--primary { font-size: 1.5em; padding: 10px; } &--user { margin: 2px; font-size: 1.5em; padding: 10px; } &:hover, &:focus { background-color: fade(#fff, 20%); } &:active { background-color: fade(#fff, 10%); } } } }