insomnia/app/css/components/sidebar.less

322 lines
6.1 KiB
Plaintext
Raw Normal View History

2016-05-01 19:56:30 +00:00
@import '../constants/dimensions';
@import '../constants/colors';
.sidebar {
2016-06-19 01:24:49 +00:00
position: relative;
2016-05-01 19:56:30 +00:00
display: grid;
2016-08-29 17:58:59 +00:00
grid-template-rows: @height-nav auto auto 1fr;
2016-09-15 22:45:08 +00:00
grid-template-columns: 100%;
2016-05-01 19:56:30 +00:00
2016-08-29 17:58:59 +00:00
background-color: @bg-dark;
color: @font-dark-bg;
2016-05-01 19:56:30 +00:00
2016-06-19 00:40:14 +00:00
width: 100%;
2016-05-01 19:56:30 +00:00
height: 100%;
// Don't collapse direct children, but their children
&.sidebar--collapsed > * > * {
opacity: 0;
transition: opacity 0.5s;
}
&.sidebar--hidden {
2016-09-13 21:18:22 +00:00
// Can't be display: none because it screws up the grid
opacity: 0;
}
&:focus {
outline: none;
}
2016-05-01 19:56:30 +00:00
// ~~~~~~~~~~~~~~ //
// Sidebar Header //
// ~~~~~~~~~~~~~~ //
.sidebar__header {
2016-08-29 17:58:59 +00:00
background-color: @bg-brand;
color: @font-brand-bg;
2016-06-19 07:37:50 +00:00
width: 100%;
height: 100%;
2016-05-01 19:56:30 +00:00
2016-06-19 07:21:43 +00:00
&:hover {
2016-08-29 17:58:59 +00:00
background-color: lighten(@bg-brand, 1);
2016-06-19 07:21:43 +00:00
}
}
// ~~~~~~~~~~~~~~~ //
// Sidebar Toolbar //
// ~~~~~~~~~~~~~~~ //
.sidebar__filter {
// Nothing yet
width: 100%;
display: grid;
2016-08-29 17:58:59 +00:00
font-size: @font-size-sm;
grid-template-columns: 1fr auto;
align-items: center;
.btn {
2016-08-29 17:58:59 +00:00
padding: 0 (@padding-md - @padding-xxs);
margin-right: @padding-xxs;
border-radius: @radius-md;
color: @hl;
&:hover,
&:focus {
2016-08-29 17:58:59 +00:00
color: @font-dark-bg;
}
}
.form-control {
2016-08-29 17:58:59 +00:00
padding: 0 @padding-xxs 0 0;
margin: @padding-sm 0 @padding-sm @padding-sm;
input {
2016-08-29 17:58:59 +00:00
padding: @padding-xs;
}
}
}
.sidebar__menu {
display: grid;
grid-template-columns: 55% 45%;
justify-items: center;
2016-08-29 17:58:59 +00:00
font-size: @font-size-sm;
color: @hl;
padding: 0 @padding-sm;
& > * {
width: 100%;
2016-08-29 17:58:59 +00:00
margin-top: @padding-sm;
}
& > *:first-child {
2016-08-29 17:58:59 +00:00
margin-right: @padding-xxs;
}
& > *:last-child {
2016-08-29 17:58:59 +00:00
margin-left: @padding-xxs;
}
2016-06-19 07:21:43 +00:00
.sidebar__menu__thing {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
2016-06-19 00:27:21 +00:00
& > *:first-child {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
2016-06-19 00:27:21 +00:00
}
2016-05-01 19:56:30 +00:00
}
.btn {
width: 100%;
border-radius: 900px;
2016-08-29 17:58:59 +00:00
height: @line-height-xxs;
padding-left: @padding-xxs;
padding-right: @padding-xxs;
&:hover,
&:focus {
2016-08-29 17:58:59 +00:00
color: @font-dark-bg;
}
}
}
&.sidebar--skinny .sidebar__filter {
grid-template-columns: 100%;
& > *:first-child {
2016-08-29 17:58:59 +00:00
margin-right: @padding-xs;
}
& > *:last-child {
display: none;
}
}
&.sidebar--skinny .sidebar__menu {
grid-template-columns: 100%;
& > *:last-child {
display: none;
2016-05-01 19:56:30 +00:00
}
.btn {
2016-08-29 17:58:59 +00:00
padding-left: @padding-xs;
padding-right: @padding-xs;
2016-05-01 19:56:30 +00:00
}
}
// ~~~~~~~~~~~~ //
// Sidebar List //
// ~~~~~~~~~~~~ //
.sidebar__list-root {
// Add some space above so it's not so squished
2016-08-29 17:58:59 +00:00
border-top: 1px solid @hl-sm;
padding-top: @padding-xs;
padding-bottom: @padding-md;
box-shadow: inset 0 2rem 3rem -2rem rgba(0, 0, 0, 0.1);
2016-05-01 19:56:30 +00:00
overflow-y: auto;
&::-webkit-scrollbar {
display: none;
}
&:hover::-webkit-scrollbar {
display: block;
}
}
// ~~~~~~~~~~~ //
// Sidebar Row //
// ~~~~~~~~~~~ //
.sidebar__row {
position: relative;
&.sidebar__row--dragging {
// Set opacity on children so we can still see the separator
& > * {
opacity: 0.2;
}
}
&.sidebar__row--dragging-below::after,
&.sidebar__row--dragging-above::before {
position: absolute;
2016-07-20 23:16:28 +00:00
height: 0;
2016-07-21 16:33:35 +00:00
right: 0;
left: 0;
2016-08-29 17:58:59 +00:00
border-bottom: 2px dotted lighten(@surprise, 5);
content: " ";
2016-07-20 23:16:28 +00:00
display: block
}
2016-05-01 19:56:30 +00:00
}
// ~~~~~~~~~~~~ //
// Sidebar Item //
// ~~~~~~~~~~~~ //
.sidebar__item {
display: grid;
grid-template-columns: 1fr auto;
2016-08-29 17:58:59 +00:00
grid-template-rows: @line-height-xs;
color: @hl-xxl;
2016-05-01 19:56:30 +00:00
& > * {
height: 100%;
}
&.sidebar__item--big {
2016-08-29 17:58:59 +00:00
grid-template-rows: @line-height-sm;
2016-05-01 19:56:30 +00:00
}
2016-07-20 23:16:28 +00:00
&.sidebar__item--active > button {
2016-08-29 17:58:59 +00:00
color: @font-dark-bg;
2016-05-01 19:56:30 +00:00
.tag {
opacity: 1;
}
.editable {
2016-08-29 17:58:59 +00:00
line-height: @line-height-xs;
}
2016-05-01 19:56:30 +00:00
}
2016-07-20 23:16:28 +00:00
&.sidebar__item--active > .sidebar__actions,
& > button:focus {
2016-08-29 17:58:59 +00:00
background-color: @hl-xxs;
2016-05-01 19:56:30 +00:00
}
2016-07-20 23:16:28 +00:00
&:hover > .sidebar__actions,
&:hover > button {
2016-08-29 17:58:59 +00:00
background-color: @hl-xxxs;
2016-07-20 23:16:28 +00:00
}
2016-05-01 19:56:30 +00:00
.tag {
2016-07-26 20:06:25 +00:00
opacity: 0.6;
2016-05-01 19:56:30 +00:00
padding-left: 0;
text-align: left;
2016-07-08 06:02:40 +00:00
width: 2.8em;
2016-07-26 20:06:25 +00:00
text-shadow: 0 0 0.1em rgba(0, 0, 0, 0.9);
2016-05-01 19:56:30 +00:00
}
}
2016-07-08 06:02:40 +00:00
.sidebar__item__icon {
2016-08-29 17:58:59 +00:00
padding-right: @padding-sm;
2016-07-08 06:02:40 +00:00
}
2016-05-01 19:56:30 +00:00
// ~~~~~~~~~~~~~~~~~ //
// Sidebar Clickable //
// ~~~~~~~~~~~~~~~~~ //
.sidebar__clickable {
2016-07-08 06:02:40 +00:00
display: grid;
grid-template-columns: auto 1fr;
align-items: center;
2016-05-01 19:56:30 +00:00
}
// Padding for nested folders
2016-05-01 19:56:30 +00:00
.sidebar__list .sidebar__clickable {
2016-08-29 17:58:59 +00:00
padding-left: @padding-md;
2016-05-01 19:56:30 +00:00
}
.sidebar__list .sidebar__list .sidebar__clickable {
2016-08-29 17:58:59 +00:00
padding-left: @padding-md * 2;
2016-05-01 19:56:30 +00:00
}
.sidebar__list .sidebar__list .sidebar__list .sidebar__clickable {
2016-08-29 17:58:59 +00:00
padding-left: @padding-md * 3;
}
.sidebar__list .sidebar__list .sidebar__list .sidebar__list .sidebar__clickable {
2016-08-29 17:58:59 +00:00
padding-left: @padding-md * 4;
}
.sidebar__list .sidebar__list .sidebar__list .sidebar__list .sidebar__list .sidebar__clickable {
2016-08-29 17:58:59 +00:00
padding-left: @padding-md * 5;
}
.sidebar__list .sidebar__list .sidebar__list .sidebar__list .sidebar__list .sidebar__list .sidebar__clickable {
2016-08-29 17:58:59 +00:00
padding-left: @padding-md * 6;
}
.sidebar__list .sidebar__list .sidebar__list .sidebar__list .sidebar__list .sidebar__list .sidebar__list .sidebar__clickable {
2016-08-29 17:58:59 +00:00
padding-left: @padding-md * 7;
}
2016-05-01 19:56:30 +00:00
// ~~~~~~~~~~~~~~~ //
// Sidebar Actions //
// ~~~~~~~~~~~~~~~ //
.sidebar__actions {
& > * {
height: 100%;
}
& > button,
& > .dropdown > button {
display: none;
2016-08-29 17:58:59 +00:00
color: @hl;
2016-05-01 19:56:30 +00:00
height: 100%;
2016-08-29 17:58:59 +00:00
padding: 0 @padding-sm;
2016-05-01 19:56:30 +00:00
}
& > button:hover,
& > .dropdown:hover > button {
2016-08-29 17:58:59 +00:00
color: @font-dark-bg;
2016-05-01 19:56:30 +00:00
}
}
.sidebar__item:hover .sidebar__actions > button,
.sidebar__item:hover .sidebar__actions > .dropdown > button {
display: initial;
}
}