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/_sidebar.scss

372 lines
6.5 KiB

11 years ago
//
// Sidebar
//
._sidebar {
position: absolute;
z-index: $sidebarZ;
top: 0;
11 years ago
bottom: 0;
left: 0;
overflow-x: hidden;
overflow-y: scroll;
padding-top: $headerHeight;
10 years ago
background: $sidebarBackground;
background-clip: content-box;
11 years ago
-webkit-overflow-scrolling: touch;
-ms-overflow-style: none; // IE 10 doesn't support pointer-events
@extend %border-box;
11 years ago
@extend %user-select-none;
&:focus { outline: none; }
._overlay-scrollbars & {
padding-top: 0;
top: $headerHeight;
}
body:not(._native-scrollbars) & {
&::-webkit-scrollbar { width: 10px; }
&::-webkit-scrollbar-track {
background: $contentBackground;
border: 0;
}
&::-webkit-scrollbar-thumb {
border-width: 3px;
&:hover, &:active { border-width: 2px; }
11 years ago
}
}
._sidebar-hidden & {
transform: translateX(-95%);
transform: translateX(calc(.5rem - 100%));
opacity: 0;
}
&:hover:not(.no-hover),
&.show {
transform: none;
opacity: 1;
}
11 years ago
}
._resizer {
position: absolute;
z-index: $sidebarZ + 1;
top: $headerHeight;
bottom: $headerHeight;
left: $sidebarWidth;
margin-left: -2px;
width: 3px;
cursor: col-resize;
._sidebar-hidden & { display: none; }
._sidebar-hidden ._sidebar.show ~ & { display: block; }
}
11 years ago
//
// List
//
._list {
margin: 0;
padding: 0;
list-style: none;
width: $sidebarWidth;
10 years ago
box-shadow: inset -1px 0 $sidebarBorder;
@extend %border-box;
11 years ago
@media #{$mediumScreen} { width: $sidebarMediumWidth; }
._sidebar > & { min-height: 100%; }
a:focus { outline: 0; }
11 years ago
}
._list-title {
position: relative;
margin: .5rem 0 0;
padding: 0 .75rem 0 2.125rem;
line-height: 2rem;
font-size: .75rem;
color: $textColorLight;
text-transform: uppercase;
cursor: default;
}
._list-title-link {
display: none;
float: right;
font-weight: normal;
text-transform: none;
._list-title:hover > & { display: block; }
}
11 years ago
._list-item {
display: block;
position: relative;
padding: .25rem .75rem;
10 years ago
line-height: 1.5rem;
11 years ago
font-size: .875rem;
cursor: default;
10 years ago
background: $sidebarBackground;
box-shadow: inset -1px 0 $sidebarBorder;
@extend %truncate-text;
11 years ago
&, &:hover {
color: inherit;
text-decoration: none;
}
&.focus,
&.focus:hover,
&.active,
&.active:hover {
10 years ago
color: $focusText;
background: $focusBackground;
box-shadow: inset -1px 0 $focusBorder;
11 years ago
}
&.active,
&.active:hover {
10 years ago
color: $selectionText;
background: $selectionBackground;
box-shadow: inset -1px 0 $selectionBorder;
11 years ago
}
&:before {
float: left;
10 years ago
margin: .25rem .625rem 0 0;
@extend %doc-icon;
11 years ago
}
}
._list-text {
display: block;
pointer-events: none;
@extend %truncate-text;
}
._list-count, ._list-enable {
11 years ago
float: right;
font-size: .75rem;
margin-left: .375rem;
11 years ago
.focus > &,
.active > & {
color: inherit;
}
}
._list-count {
color: $textColorLighter;
pointer-events: none;
._list-disabled:hover > & { display: none; }
}
._list-enable {
display: none;
color: $linkColor;
cursor: pointer;
&:hover { text-decoration: underline; }
._list-disabled:hover > &, ._list-result > & { display: block; }
._list-result.active > & { margin-right: -1rem; }
}
11 years ago
//
// List hierarchy
//
._list-dir:not(._list-rdir),
11 years ago
%_list-dir {
padding-left: 2.125rem;
11 years ago
}
._list-disabled {
@extend %_list-dir;
&, &:hover { color: $textColorLight; }
&:before { opacity: .7; }
}
._list-arrow {
position: absolute;
top: 0;
left: .25rem;
padding: .5rem .375rem .5rem .5rem;
width: 1rem;
height: 1rem;
11 years ago
cursor: pointer;
fill: black;
10 years ago
opacity: .4;
11 years ago
@if $style == 'dark' { fill: white; }
10 years ago
&:hover { opacity: .65; }
11 years ago
._list-rdir > & {
left: auto;
right: .25rem;
}
.open > &, .open-title > & {
-webkit-transform: rotate(90deg);
transform: rotate(90deg);
}
11 years ago
}
._list-sub {
display: none;
.open + & { display: block; }
> ._list-item { padding-left: 2.375rem; }
> ._list-dir, > ._list-sub > ._list-item { padding-left: 2.75rem; }
> ._list-disabled { padding-left: 3.75rem; }
11 years ago
> ._list-item:before { content: none; }
10 years ago
> ._list-dir { line-height: 1.375rem; }
11 years ago
._list-arrow {
left: 1rem;
10 years ago
padding: .4375rem;
11 years ago
}
}
//
// List pagination
//
._list-pagelink {
color: $linkColor;
cursor: pointer;
&:hover {
color: $linkColorHover;
text-decoration: underline;
}
}
//
// Search results
//
._list-result.active {
padding-right: 1.75rem;
> ._list-reveal { display: block; }
> ._list-count { display: none; }
}
._list-reveal {
display: none;
position: absolute;
top: 0;
bottom: 0;
right: 0;
width: 2rem;
cursor: pointer;
&:before {
content: '';
position: absolute;
bottom: 50%;
left: .75rem;
width: .75rem;
height: 1px;
10 years ago
background: rgba($selectionText, .9);
box-shadow: 0 -3px rgba($selectionText, .9), // top line
0 3px rgba($selectionText, .9); // bottom line
}
}
//
// List note
//
._list-note {
10 years ago
padding: .5rem .75rem;
line-height: 1.25rem;
font-size: .8125rem;
color: $textColorLight;
10 years ago
& + & { padding-top: 0; }
}
._list-note-link { cursor: pointer; }
//
// List hover clone
//
._list-hover.clone {
position: fixed;
overflow: visible;
z-index: $hoverZ;
left: 0;
10 years ago
min-width: $sidebarWidth;
padding: .25rem .75rem;
pointer-events: none;
-webkit-font-smoothing: subpixel-antialiased;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
10 years ago
@extend %border-box;
@media #{$mediumScreen} { min-width: $sidebarMediumWidth; }
> ._list-text { display: inline; }
&:not(._list-result) {
padding-left: 2.75rem;
&:before { content: none; }
}
._list-reveal, ._list-enable { display: none; }
}
11 years ago
//
// List picker
//
._list-picker {
._list-item { cursor: pointer; }
._list-sub > ._list-item { padding-left: 2.375rem; }
}
._list-picker-head {
display: flex;
justify-content: space-between;
position: -webkit-sticky;
position: sticky;
top: 0;
z-index: 1;
margin-right: 1px;
padding: .5rem .75rem .25rem .75rem;
line-height: 1.5rem;
font-size: .75rem;
font-weight: $bolderFontWeight;
color: $textColorLight;
text-transform: uppercase;
background: linear-gradient(to bottom, $sidebarBackground, $sidebarBackground 75%, rgba($sidebarBackground, 0));
cursor: default;
}
11 years ago
._list-checkbox {
position: absolute;
top: .5rem;
right: .75rem;
11 years ago
}
._list-link {
display: block;
padding: .75rem 0;
11 years ago
font-size: .8125rem;
text-align: center;
@extend %external-link;
&:after { visibility: hidden; }
&:hover:after { visibility: visible; }
}