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

455 lines
7.9 KiB

11 years ago
//
// Sidebar
//
._sidebar {
position: absolute;
z-index: $sidebarZ;
top: $headerHeight;
bottom: 0;
left: 0;
10 years ago
margin-top: 1px;
11 years ago
overflow-x: hidden;
overflow-y: scroll;
10 years ago
background: $sidebarBackground;
11 years ago
-webkit-overflow-scrolling: touch;
-ms-overflow-style: none; // IE 10 doesn't support pointer-events
@extend %user-select-none;
10 years ago
&::-webkit-scrollbar { -webkit-appearance: none; width: 10px; }
11 years ago
&::-webkit-scrollbar-button { display: none; }
10 years ago
&::-webkit-scrollbar-track { background: $contentBackground; }
11 years ago
&::-webkit-scrollbar-thumb {
10 years ago
min-height: 2rem;
background: $scrollbarColor;
11 years ago
background-clip: padding-box;
10 years ago
border: 3px solid $contentBackground;
11 years ago
border-radius: 5px;
&:active {
10 years ago
background-color: $scrollbarColorHover;
11 years ago
border-width: 2px;
}
}
a:focus { outline: 0; }
11 years ago
}
._resizer {
position: absolute;
z-index: $sidebarZ + 1;
top: $headerHeight;
bottom: 0;
left: $sidebarWidth;
margin-left: -2px;
width: 3px;
cursor: col-resize;
}
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%;
padding-bottom: 3.5rem;
}
}
._list-title {
position: relative;
margin: .5rem 0 0;
padding-left: 2.25rem;
line-height: 2rem;
font-size: .75rem;
color: $textColorLight;
text-transform: uppercase;
cursor: default;
}
11 years ago
._list-item {
display: block;
position: relative;
overflow: hidden;
padding: .25rem .75rem;
10 years ago
line-height: 1.5rem;
11 years ago
font-size: .875rem;
white-space: nowrap;
word-wrap: normal;
overflow-wrap: normal;
11 years ago
text-overflow: ellipsis;
cursor: default;
10 years ago
background: $sidebarBackground;
box-shadow: inset -1px 0 $sidebarBorder;
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;
11 years ago
@extend %icon;
}
}
._list-count, ._list-enable {
11 years ago
float: right;
font-size: .75rem;
.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; }
}
11 years ago
//
// List hierarchy
//
._list-dir:not(._list-rdir),
11 years ago
%_list-dir {
padding-left: 2.25rem;
}
._list-disabled {
@extend %_list-dir;
&, &:hover { color: $textColorLight; }
&:before { opacity: .7; }
}
._list-arrow {
position: absolute;
top: 0;
left: .25rem;
padding: .5rem;
cursor: pointer;
10 years ago
opacity: .4;
11 years ago
10 years ago
&:hover { opacity: .65; }
11 years ago
._list-rdir > & {
left: auto;
right: .25rem;
}
11 years ago
&:before {
@if $style == 'dark' {
@extend %icon, %icon-dir-white;
} @else {
@extend %icon, %icon-dir;
}
11 years ago
.open > &, .open-title > & {
11 years ago
-webkit-transform: rotate(90deg);
transform: rotate(90deg);
}
}
}
._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.875rem; }
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-reveal {
display: none;
position: absolute;
top: 0;
bottom: 0;
right: 0;
width: 1.75rem;
cursor: pointer;
&:before {
content: '';
position: absolute;
bottom: 50%;
left: .5rem;
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;
z-index: $hoverZ;
left: 0;
overflow: visible;
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; }
&:not(._list-result) {
padding-left: 2.75rem;
&:before { content: none; }
}
}
11 years ago
//
// List picker
//
._list-picker {
opacity: 0;
transition: .2s;
&._in { opacity: 1; }
._list-item { cursor: pointer; }
._list-sub > ._list-item { padding-left: 2.375rem; }
}
11 years ago
._list-checkbox {
position: absolute;
top: .5rem;
right: .75rem;
11 years ago
width: 1rem;
height: 1rem;
transition: .2s;
}
._list-link {
display: block;
margin-top: .75rem;
font-size: .8125rem;
text-align: center;
@extend %external-link;
&:after { visibility: hidden; }
&:hover:after { visibility: visible; }
}
//
// Footer
//
._sidebar-footer {
position: fixed;
bottom: 0;
left: 0;
width: $sidebarWidth;
10 years ago
background: $sidebarBackground;
box-shadow: inset -1px 0 $sidebarBorder;
11 years ago
@media #{$mediumScreen} { width: $sidebarMediumWidth; }
._max-width & {
left: calc(50% - #{$maxWidth} / 2);
@media (max-width: #{$maxWidth}) { left: 0; }
}
11 years ago
&:before {
content: '';
position: absolute;
bottom: 100%;
left: 0;
right: 1px;
height: 1em;
10 years ago
background-image: -webkit-linear-gradient(top, rgba($sidebarBackground, 0), rgba($sidebarBackground, .95));
background-image: linear-gradient(to bottom, rgba($sidebarBackground, 0), rgba($sidebarBackground, .95));
11 years ago
pointer-events: none;
}
}
._sidebar-footer-link {
position: relative;
display: block;
overflow: hidden;
11 years ago
height: 2.5rem;
line-height: 1rem;
padding: .75rem .25rem .75rem .75rem;
11 years ago
font-size: .875em;
cursor: pointer;
@extend %border-box;
&, &:hover {
color: inherit;
text-decoration: none;
}
&:before {
float: left;
margin-right: .625rem;
@extend %icon;
}
}
._sidebar-footer-edit {
@if $style == 'dark' {
&:before { @extend %icon-settings-white; }
} @else {
&:before { @extend %icon-settings; }
}
}
._sidebar-footer-light {
float: right;
width: 2rem;
padding: 0;
opacity: .65;
&:before {
float: none;
position: absolute;
top: .75rem;
left: .25rem;
@if $style == 'dark' {
@extend %icon-light-white;
} @else {
@extend %icon-light;
}
}
11 years ago
}
._sidebar-footer-layout {
float: right;
width: 2rem;
padding: 0;
opacity: .65;
&:before {
float: none;
position: absolute;
top: .75rem;
left: .375rem;
@if $style == 'dark' {
@extend %icon-expand-white;
} @else {
@extend %icon-expand;
}
._max-width & {
@if $style == 'dark' {
@extend %icon-contract-white;
} @else {
@extend %icon-contract;
}
}
}
@media (max-width: #{$maxWidth + .1rem}) { display: none; }
}
11 years ago
._sidebar-footer-save {
margin-right: 1px;
font-weight: bold;
10 years ago
background: $noteGreenBackground;
box-shadow: inset 0 1px $noteGreenBorder,
1px 0 $noteGreenBorder;
11 years ago
@if $style == 'dark' {
&:before { @extend %icon-check-white; }
} @else {
&:before { @extend %icon-check; }
}
11 years ago
}