header { @include container; position: fixed; top: 0; background: var(--background-color); box-shadow: 0 1px 1px $divider, 0 -2px var(--theme-color); display: flex; align-items: center; min-height: var(--header-height); flex-wrap: wrap; z-index: 10; will-change: transform; margin-bottom: 7px; } #scroll-indicator { position: absolute; bottom: -2px; left: 0; height: 2px; background: var(--theme-color); border-bottom-right-radius: 1px; border-top-right-radius: 1px; } // Logo .logo { height: var(--header-height); display: flex; align-items: center; svg { fill: var(--text-color); stroke: var(--text-color); width: 130px; height: 47px; } } // Hamburger Icon $hamburger-size: calc(8px + var(--header-height) / 2); .hamburger { display: block; width: $hamburger-size; height: $hamburger-size; margin: calc(calc(var(--header-height) - #{$hamburger-size}) / 2) 0; position: absolute; cursor: pointer; top: 0; // hide this opacity: 0; // and place it over the hamburger z-index: 2; } .hamburger ~ .icon { display: block; width: $hamburger-size; height: $hamburger-size; position: relative; background: #EEE; z-index: 1; padding: 4px; fill: rgba(0, 0, 0, 0.5); border-radius: 2px; margin: 0 15px 0 0; svg { width: 100%; height: 100%; } } .hamburger:checked ~ .icon { .bar:nth-of-type(2) { opacity: 0; } .bar:nth-of-type(3) { transform: translateY(+5px) translateX(4px) rotateZ(-225deg); transform-origin: center; } .bar:nth-of-type(1) { transform: translateY(-5px) translateX(2px) rotateZ(225deg); transform-origin: center; } } @include media(">=md") { .hamburger, .hamburger ~ .icon { display: none; } } // Menu @include media("=md") { display: inline-flex; flex-wrap: wrap; align-items: stretch; height: var(--header-height); } } .top-menu-item { list-style: none; display: flex; align-items: center; &.active>a, &:hover>a { color: var(--theme-color); } @include media(">=md") { position: relative; &.active::after { content: " "; background: var(--theme-color); position: absolute; width: 100%; left: 0; bottom: 0; height: 5px; } } a { text-decoration: none; color: inherit; display: inline-block; width: 100%; @include media(">=lg") { padding: 10px 20px; } @include media("a, &:hover>a { color: var(--theme-color); } &:not(:last-child) { border-bottom: 1px dotted $divider; } } @include media("md") { .top-menu-item:hover .sub-menu { max-height: 100vh; opacity: 1; border: 1px solid $divider; } } // GitHub Corner .github-corner { svg { width: var(--header-height); height: var(--header-height); color: var(--background-color); fill: var(--theme-color); position: absolute; top: 0; border: 0; right: 0; } &:before { content: " "; position: absolute; right: 0; top: -200px; height: 200px; z-index: 1; background: var(--theme-color); width: var(--header-height); } .octo-arm { transform-origin: 130px 106px; } position: absolute; top: 0; border: 0; right: 0; } .github-corner:hover .octo-arm { animation: octocat-wave 560ms ease-in-out } @keyframes octocat-wave { 0%, 100% { transform: rotate(0) } 20%, 60% { transform: rotate(-25deg) } 40%, 80% { transform: rotate(10deg) } } @include media("svg { position: absolute; left: 7px; top: calc(var(--header-height)/4 + 7px); color: rgba(var(--text-color-rgb), 0.2); pointer-events: none; @include media(">=lg") { top: calc(var(--header-height)/4 + 10px) } } input{ height: calc(var(--header-height)/2); line-height: calc(var(--header-height)/2); font-size: calc(var(--header-height)/5); border-radius: 50px; padding: 7px 10px 7px 30px; background: none; width: 170px; & ~ .results { width: 130px; } &:focus { width: 300px; & ~ .results{ width: 260px; max-height: 500px; transition: width .2s ease-in-out, max-height 0.5s ease-in-out; } & ~ svg { color: rgba(var(--text-color-rgb), 0.6); } } transition: all .2s ease-in-out; } .results { max-height: 0; overflow: hidden; background: var(--background-color); border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; margin: -2px 20px 0; box-shadow: 0 2px 2px #bbb; & >div { &.hidden { display: none; } &.selected { background: rgba(var(--theme-color-rgb), 0.1); } cursor: pointer; border-bottom: 1px solid #eee; padding: 10px; height: 80px; img { float: left; border-radius: 3px; background: #DDD; min-height: 50px; margin: 5px 10px 5px 0; } h2 { font-size: 12px; line-height: 14px; margin: 0; white-space: nowrap; text-overflow: ellipsis; padding: 0; overflow: hidden; } .description { font-size: 10px; line-height: 12px; overflow: hidden; text-overflow: ellipsis; height: 30px; text-align: left; padding: 3px 0; } &>span { font-size: 8px; line-height: 10px; display: flex; align-items: center; white-space: nowrap; height: 14px; overflow: hidden; text-overflow: ellipsis; .category { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } svg { margin: 0 2px 0 5px; min-width: 12px; &:first-of-type { margin-left: 0; } } } &::after { content: " "; display: block; clear: both; } } transition: width .2s ease-in-out; } @include media("svg { top: calc(7px + var(--header-height)/4) } .results { margin-left: 10px; margin-right: 10px; } input:focus { width: calc(var(--max-width)); & ~ .results { width: calc(var(--max-width) - 20px); } } } @media(max-width: $search-follow) { right: var(--header-height); input:focus { margin-left: 20px; width: calc(100vw - 2*var(--header-height)); & ~ .results { margin-left: 30px; width: calc(100vw - 2*var(--header-height) - 20px); } } input:focus ~ svg { left:27px; } } @include media("