insomnia/app/css/components/sidebar.scss

241 lines
4.3 KiB
SCSS
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;
grid-template-rows: $line-height-md 1fr auto;
2016-05-01 19:56:30 +00:00
grid-template-columns: 1fr;
background-color: $bg-dark;
color: $font-dark-bg;
2016-06-19 00:40:14 +00:00
width: 100%;
2016-05-01 19:56:30 +00:00
height: 100%;
&:focus {
outline: none;
}
2016-05-01 19:56:30 +00:00
// ~~~~~~~~~~~~~~ //
// Sidebar Header //
// ~~~~~~~~~~~~~~ //
.sidebar__header {
background-color: $bg-brand;
color: $font-brand-bg;
2016-06-19 07:37:50 +00:00
width: 100%;
2016-05-01 19:56:30 +00:00
2016-06-19 07:21:43 +00:00
&:hover {
background-color: lighten($bg-brand, 1);
}
2016-06-19 00:27:21 +00:00
h1 {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
// HACK: Bump up the arrow a bit
2016-06-19 00:51:15 +00:00
i.fa-caret-down {
2016-06-19 00:27:21 +00:00
position: relative;
top: -2px;
}
2016-05-01 19:56:30 +00:00
}
// Make the dropdown offset to the right
.dropdown ul {
right: -40%;
}
.btn {
padding: 0 $padding-md;
}
}
// ~~~~~~~~~~~~ //
// Sidebar List //
// ~~~~~~~~~~~~ //
.sidebar__list {
}
// Root list scrolling
& > .sidebar__list {
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-07-20 23:16:28 +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;
grid-template-rows: $line-height-xs;
color: $hl;
& > * {
height: 100%;
}
&.sidebar__item--big {
grid-template-rows: $line-height-sm;
}
2016-07-20 23:16:28 +00:00
&.sidebar__item--active > button {
2016-05-01 19:56:30 +00:00
color: $font-dark-bg;
.tag {
opacity: 1;
}
}
2016-07-20 23:16:28 +00:00
&.sidebar__item--active > .sidebar__actions,
& > button:focus {
2016-05-01 19:56:30 +00:00
background-color: $hl-xxs;
}
2016-07-20 23:16:28 +00:00
&:hover > .sidebar__actions,
&:hover > button {
background-color: $hl-xxxs;
}
2016-05-01 19:56:30 +00:00
.tag {
2016-06-18 21:02:27 +00:00
opacity: 0.5;
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-05-01 19:56:30 +00:00
}
}
2016-07-08 06:02:40 +00:00
.sidebar__item__icon {
padding-right: $padding-sm;
}
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
.sidebar__list .sidebar__clickable {
2016-06-19 01:57:23 +00:00
padding-left: $padding-md;
2016-05-01 19:56:30 +00:00
}
.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;
}
2016-05-01 19:56:30 +00:00
// ~~~~~~~~~~~~~~~ //
// 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: $font-dark-bg;
}
}
.sidebar__item:hover .sidebar__actions > button,
.sidebar__item:hover .sidebar__actions > .dropdown > button {
display: initial;
}
// ~~~~~~~~~~~~~~ //
// Sidebar Footer //
// ~~~~~~~~~~~~~~ //
2016-07-19 16:15:03 +00:00
.sidebar__footer {
// Nothing yet
2016-07-21 19:15:35 +00:00
display: flex;
flex-direction: row;
align-items: center;
.btn {
color: $hl;
}
.form-control {
padding: 0;
width: 100%;
input {
padding: $padding-xs;
}
}
2016-05-01 19:56:30 +00:00
}
}