.header { --header-image-px: 60px; --header-link-margin: 14px; flex: 0 0 auto; position: absolute; top: 0; left: 0; right: 0; z-index: 500; &__background { position: absolute; top: 0; left: 0; width: 100%; height: 100%; 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 } --header-background-mask-image: linear-gradient(180deg, var(--background-colour) 0, transparent 100%); @media (min-width: @site-mobile-width) { &--floating { position: fixed; --header-background-mask-image: linear-gradient(180deg, var(--background-colour) 90%, transparent 100%); --header-image-px: 40px; --header-link-margin: 4px; --header-height: var(--header-height-floating); } &:hover, &:focus, &:focus-within, &:active { --header-background-mask-image: linear-gradient(180deg, var(--background-colour) calc(var(--header-height-open) - 10px), transparent 100%); --header-height: var(--header-height-open); } } &__desktop { margin: 0 auto; display: flex; align-items: flex-start; padding: 5px 4px 4px; max-width: var(--site-max-width); height: var(--header-height); transition: height .1s; overflow: hidden; @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: 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%; } &__menu { height: 100%; margin: 0 5px; } &__link { color: inherit; text-decoration: none; display: block; min-width: 100px; padding: 4px 10px; cursor: pointer; opacity: .4; border-radius: 2px; transition: background-color .2s, margin .1s, opacity .1s; &--primary { margin: var(--header-link-margin) 0; font-size: 1.2em; padding: 6px 10px; } &:hover, &:focus { background-color: fade(#fff, 20%); } &:active { background-color: fade(#fff, 10%); } } &__menu:hover &__link, &__menu:active &__link, &__menu:focus &__link, &__menu:focus-within &__link, &__menus:not(:hover) &__link--primary { opacity: 1; } &__user { flex: 0 0 auto; display: flex; align-items: center; margin-left: auto; &__avatar { width: var(--header-image-px); height: var(--header-image-px); margin-left: 5px; transition: box-shadow .2s, width .1s, height .1s; box-shadow: 0 0 4px #111; &:hover, &:active, &:focus { box-shadow: 0 0 4px var(--header-accent-colour); } } &__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: var(--header-accent-colour); opacity: .9; border-radius: 4px; line-height: 12px; padding: 2px 4px; } } } } &__mobile { --header-icon-px: 40px; display: block; @media (min-width: @site-mobile-width) { display: none; } &__icons { display: flex; justify-content: space-between; height: var(--header-height-mobile); padding: 5px; z-index: 500; -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: 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: var(--site-logo); font-size: 0; } &__avatar { transition: box-shadow .2s; box-shadow: 0 0 4px #111; &:hover, &:active, &:focus { box-shadow: 0 0 4px var(--header-accent-colour); } } &__toggle { display: none; } &__menu { position: absolute; left: 0; right: 0; z-index: 499; padding: var(--header-height-mobile) 5px 5px; background: var(--background-pattern); background-color: var(--header-accent-colour); background-blend-mode: multiply; top: -100vh; transition: top .2s; box-shadow: 0 1px 2px #000A; text-shadow: 0 1px 4px #000; } &__toggle:checked ~ &__menu { display: block; top: 0; } &__user { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid #fff; margin-bottom: 5px; padding-bottom: 3px; // extra 2px is provided by the buttons } &__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%); } } } }