You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
devdocs/assets/stylesheets/components/_header.scss

233 lines
4.0 KiB

11 years ago
//
// Header
//
._header {
position: absolute;
z-index: $headerZ;
top: 0;
left: 0;
8 years ago
display: flex;
width: $sidebarWidth;
11 years ago
height: $headerHeight;
10 years ago
background: $headerBackground;
border-bottom: 1px solid $headerBorder;
border-right: 1px solid $headerBorder;
@extend %border-box;
11 years ago
@extend %user-select-none;
8 years ago
@media #{$mediumScreen} { width: $sidebarMediumWidth; }
11 years ago
}
8 years ago
._header-left {
float: left;
height: 100%;
}
11 years ago
8 years ago
._header-right {
11 years ago
float: right;
8 years ago
height: 100%;
11 years ago
}
8 years ago
._header-btn {
10 years ago
position: relative;
flex: 0 0 auto;
8 years ago
width: 2.25rem;
height: 100%;
color: $textColorLight;
text-align: center;
8 years ago
&[hidden] { display: none; }
11 years ago
8 years ago
&[disabled] {
opacity: .3;
cursor: not-allowed;
10 years ago
}
8 years ago
> svg {
display: inline-block;
vertical-align: top;
width: 1.5rem;
height: 1.5rem;
fill: currentColor;
pointer-events: none;
10 years ago
}
}
8 years ago
//
// Menu
//
8 years ago
._menu {
position: absolute;
z-index: 1;
top: .25rem;
right: .25rem;
width: 8.5rem;
height: calc(13.75rem + 1px);
white-space: nowrap;
word-wrap: normal;
overflow-wrap: normal;
8 years ago
font-size: .875rem;
background: $contentBackground;
border: 1px solid $headerBorder;
border-radius: 3px;
box-shadow: -1px 1px 1px rgba(black, .05);
transition: all 250ms cubic-bezier(0.23, 1, 0.32, 1);
opacity: 0;
-webkit-transform: scale(0, 0);
transform: scale(0, 0);
-webkit-transform-origin: 100% 0;
transform-origin: 100% 0;
&:hover,
._menu-btn:hover + & {
transition-delay: 100ms;
}
11 years ago
8 years ago
&:hover,
&.active,
._menu-btn:hover + &,
._menu-btn:focus + & {
opacity: 1;
-webkit-transform: scale(1, 1);
transform: scale(1, 1);
}
&:focus-within {
opacity: 1;
-webkit-transform: scale(1, 1);
transform: scale(1, 1);
}
}
._menu-title {
11 years ago
margin: 0;
8 years ago
line-height: 1.5rem;
font-size: 1rem;
font-weight: $boldFontWeight;
8 years ago
letter-spacing: -.5px;
background: $sidebarBackground;
border-bottom: 1px solid $sidebarBorder;
border-radius: 2px 2px 0 0;
}
._menu-title-link,
._menu-title-link:hover {
display: block;
padding: .5rem 1rem;
color: $focusText;
text-decoration: none;
}
11 years ago
8 years ago
._menu-link {
display: block;
padding: 0 1rem;
line-height: 2.25rem;
color: inherit;
text-decoration: none;
&:hover {
color: $focusText;
text-decoration: none;
background: $sidebarBackground;
11 years ago
}
8 years ago
&:last-child { border-radius: 0 0 2px 2px; }
11 years ago
}
//
// Search form
//
._search {
8 years ago
flex-grow: 1;
11 years ago
position: relative;
height: 100%;
10 years ago
padding: .5rem 0 .5rem .5rem;
11 years ago
@extend %border-box;
&:before {
position: absolute;
8 years ago
z-index: 1;
8 years ago
top: calc(1rem - 1px);
11 years ago
left: 1rem;
10 years ago
opacity: .4;
8 years ago
pointer-events: none;
@if $style == 'dark' {
@extend %icon, %icon-search-white;
} @else {
@extend %icon, %icon-search;
}
11 years ago
}
}
._search-input {
8 years ago
position: relative;
11 years ago
display: block;
width: 100%;
height: 100%;
10 years ago
padding: 0 .75rem 1px 1.75rem;
11 years ago
font-size: .875rem;
10 years ago
background: $contentBackground;
11 years ago
border: 1px solid;
10 years ago
border-color: darken($headerBorder, 2%);
border-radius: 3px;
11 years ago
&:focus {
outline: 0;
@if $inputFocusBorder {
border-color: $inputFocusBorder;
box-shadow: 0 0 1px $inputFocusBorder;
}
11 years ago
}
&[disabled] {
background: $sidebarBackground;
cursor: not-allowed;
}
11 years ago
}
._search-clear {
display: none;
position: absolute;
top: .5em;
10 years ago
right: 0;
9 years ago
width: 2rem;
height: 2rem;
11 years ago
opacity: .3;
9 years ago
@extend %hide-text;
11 years ago
&:hover { opacity: .5; }
9 years ago
&:before {
position: absolute;
top: .5rem;
left: .5rem;
@extend %icon;
}
@if $style == 'dark' {
9 years ago
&:before { @extend %icon-close-white; }
} @else {
9 years ago
&:before { @extend %icon-clear; }
}
11 years ago
._search-active > & { display: block; }
}
._search-tag {
display: none;
position: absolute;
8 years ago
z-index: 2;
11 years ago
top: .875rem;
left: .875rem;
padding: 0 .375rem;
11 years ago
line-height: 1.25rem;
max-width: 50%;
font-size: .8125rem;
10 years ago
color: $textColorLight;
background: darken($headerBackground, 5%);
border-radius: 2px;
@extend %truncate-text;
11 years ago
}