insomnia/app/ui/css/components/sidebar.less
2017-04-20 21:30:52 -07:00

367 lines
7.2 KiB
Plaintext

@import '../constants/dimensions';
@import '../constants/colors';
.sidebar {
position: relative;
display: grid;
grid-template-rows: @height-nav @line-height-sm auto minmax(0, 1fr) auto;
grid-template-columns: 100%;
z-index: 10;
background-color: var(--color-bg);
color: var(--color-font);
width: 100%;
height: 100%;
&.sidebar--collapsed > * > * {
display: none;
}
&.sidebar--hidden {
// It proved difficult to keep the invisible children from overflowing when
// hidden, so we're just going to bump it way to the left to be sure.
left: -9999px;
}
&:focus {
outline: none;
}
// ~~~~~~~~~~~~~~ //
// Sidebar Header //
// ~~~~~~~~~~~~~~ //
.sidebar__header {
border-top: 1px solid @hl-md;
border-bottom: 1px solid @hl-md;
box-sizing: border-box;
background-color: var(--color-bg);
color: var(--color-font);
width: 100%;
height: 100%;
h1 {
margin: 0;
}
h1, h1 * {
font-size: @font-size-xl;
}
}
// ~~~~~~~~~~~~~~~ //
// Sidebar Toolbar //
// ~~~~~~~~~~~~~~~ //
.sidebar__filter {
// Nothing yet
display: grid;
font-size: @font-size-sm;
grid-template-columns: minmax(0, 1fr) auto;
align-items: center;
box-sizing: border-box;
padding: 0 0 0 @padding-sm;
.btn {
padding: 0 (@padding-md - @padding-xs);
margin-right: @padding-xxs;
border-radius: @radius-md;
margin-left: @padding-xxs;
margin-bottom: @padding-xs;
height: @line-height-xxs;
}
.form-control input {
padding: @padding-xs;
margin-top: 0;
height: auto;
background: transparent;
}
}
.sidebar__menu {
box-sizing: border-box;
width: 100%;
display: grid;
grid-template-columns: 55% 45%;
justify-items: center;
font-size: @font-size-sm;
color: @hl;
padding: 0 @padding-sm;
& > * {
width: 100%;
margin-top: @padding-xs;
}
& > *:first-child {
margin-right: @padding-xxs;
}
& > *:last-child {
margin-left: @padding-xxs;
}
.sidebar__menu__thing {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
& > .sidebar__menu__thing__text {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
i.fa {
// Bump the drop down caret down a bit
position: relative;
top: 1px;
}
}
.btn {
width: 100%;
border-radius: 900px;
height: @line-height-xxs;
padding-left: @padding-xxs;
padding-right: @padding-xxs;
color: var(--color-font);
&:hover,
&:focus {
opacity: 1;
}
}
}
&.sidebar--skinny .sidebar__filter {
grid-template-columns: 100%;
padding-right: @padding-sm;
& > *:first-child {
margin-right: @padding-xs;
}
& > *:last-child {
display: none;
}
}
&.sidebar--skinny .sidebar__menu {
grid-template-columns: 100%;
& > *:last-child {
display: none;
}
.btn {
padding-left: @padding-xs;
padding-right: @padding-xs;
}
}
// ~~~~~~~~~~~~ //
// Sidebar List //
// ~~~~~~~~~~~~ //
.sidebar__list-root {
// Add some space above so it's not so squished
border-top: 1px solid @hl-sm;
padding-top: @padding-xs;
padding-bottom: @padding-md;
box-shadow: inset 0 2rem 2rem -2rem rgba(0, 0, 0, 0.03);
overflow-y: auto;
&::-webkit-scrollbar {
display: none;
}
&:hover::-webkit-scrollbar {
display: block;
}
}
.sidebar__list--collapsed > * {
display: none;
}
// ~~~~~~~~~~~ //
// Sidebar Row //
// ~~~~~~~~~~~ //
.sidebar__row {
position: relative;
&.sidebar__row--dragging {
// Set opacity on children so we can still see the separator
& > * {
opacity: 0.3;
}
}
&.sidebar__row--dragging-below::after,
&.sidebar__row--dragging-above::before {
position: absolute;
height: 0;
right: 0;
left: 0;
border-bottom: 2px dotted var(--color-surprise);
content: " ";
display: block
}
}
// ~~~~~~~~~~~~ //
// Sidebar Item //
// ~~~~~~~~~~~~ //
.sidebar__item {
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
grid-template-rows: @line-height-xs;
& > button {
color: @hl;
}
& > * {
height: 100%;
}
&.sidebar__item--big {
grid-template-rows: @line-height-sm;
}
&.sidebar__item--active > button {
color: var(--color-font);
.tag {
opacity: 1;
}
}
// Active sidebar request
&.sidebar__item--request > button {
border-left: @padding-xs solid transparent;
}
&.sidebar__item--active.sidebar__item--request > button,
&.sidebar__item--active.sidebar__item--request > .sidebar__actions,
&:hover > button,
& > button:focus,
&:hover .sidebar__actions {
transition: background-color 130ms ease-out;
background-color: @hl-xs;
}
.tag {
padding-left: 0;
text-align: left;
width: 3em;
}
}
.sidebar__item__icon {
padding-right: @padding-sm;
}
// ~~~~~~~~~~~~~~~~~ //
// Sidebar Clickable //
// ~~~~~~~~~~~~~~~~~ //
.sidebar__clickable {
display: grid;
grid-template-columns: auto minmax(0, 1fr);
align-items: center;
height: 100%;
& > *:last-child {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
// Padding for nested folders
.sidebar__list .sidebar__clickable {
padding-left: @padding-md;
}
.sidebar__list .sidebar__list .sidebar__clickable {
padding-left: @padding-md * 2;
}
.sidebar__list .sidebar__list .sidebar__list .sidebar__clickable {
padding-left: @padding-md * 3;
}
.sidebar__list .sidebar__list .sidebar__list .sidebar__list .sidebar__clickable {
padding-left: @padding-md * 4;
}
.sidebar__list .sidebar__list .sidebar__list .sidebar__list .sidebar__list .sidebar__clickable {
padding-left: @padding-md * 5;
}
.sidebar__list .sidebar__list .sidebar__list .sidebar__list .sidebar__list .sidebar__list .sidebar__clickable {
padding-left: @padding-md * 6;
}
.sidebar__list .sidebar__list .sidebar__list .sidebar__list .sidebar__list .sidebar__list .sidebar__list .sidebar__clickable {
padding-left: @padding-md * 7;
}
// ~~~~~~~~~~~~~~~ //
// Sidebar Actions //
// ~~~~~~~~~~~~~~~ //
.sidebar__actions {
& > * {
height: 100%;
}
& > button,
& > .dropdown > button {
display: none;
color: @hl;
height: 100%;
padding: 0 @padding-sm;
}
& > button:hover,
& > .dropdown:hover > button {
color: var(--color-font);
}
}
.sidebar__item:hover .sidebar__actions > button,
.sidebar__item:hover .sidebar__actions > .dropdown > button {
display: initial;
}
// ~~~~~~~~~~~~~~ //
// Sidebar Footer //
// ~~~~~~~~~~~~~~ //
.sidebar__footer {
height: @line-height-xs;
border-top: 1px solid @hl-md;
width: 100%;
}
.sidebar__footer > button,
.sidebar__footer .dropdown > button {
font-size: @font-size-sm;
padding: @padding-xs @padding-md;
height: 100%;
margin: 0;
color: @hl;
box-sizing: border-box;
overflow: hidden;
}
}