insomnia/packages/insomnia-app/app/ui/css/components/sidebar.less
Evans Y 955131472a * Implemented normal, monospace font selection and on-pff for font variant (#1213)
ligatures

* Make font-size and font-family based on CSS variables
2018-10-17 13:26:19 -04:00

386 lines
7.4 KiB
Plaintext

@import '../constants/dimensions';
@import '../constants/colors';
.sidebar {
position: relative;
display: grid;
grid-template-rows: @height-nav auto 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 calc(@padding-md - @padding-xs);
margin-right: @padding-xxs;
border-radius: @radius-md;
margin-left: @padding-xxs;
margin-bottom: @padding-sm;
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: flex;
flex-direction: row;
flex-wrap: wrap;
font-size: @font-size-sm;
color: @hl;
padding-left: @padding-xs;
padding-right: @padding-xs;
// Make it scroll when too skinny
overflow: auto;
&::-webkit-scrollbar {
display: none;
}
& > * {
flex: 1;
margin-top: @padding-xs;
margin-bottom: @padding-xs;
max-width: 100%;
}
& > .dropdown > * {
width: 100%;
}
& > *: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 {
border-radius: 900px;
height: @line-height-xxs;
padding-left: @padding-xxs;
padding-right: @padding-xxs;
color: var(--color-font);
&:hover,
&:focus {
opacity: 1;
}
}
}
.sidebar__top {
background: var(--color-bg);
color: var(--color-font);
}
&.sidebar--skinny .sidebar__filter {
grid-template-columns: 100%;
padding-right: @padding-sm;
& > *:first-child {
margin-right: @padding-xs;
}
& > *:last-child {
display: none;
}
}
// ~~~~~~~~~~~~ //
// Sidebar List //
// ~~~~~~~~~~~~ //
.sidebar__list-root {
// Add some space above so it's not so squished
padding-top: @padding-xxs;
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;
}
}
& > button {
border-left: @padding-xxs solid transparent;
}
&.sidebar__item--active.sidebar__item--request,
&:focus,
&:hover {
background-color: @hl-xs;
transition: background-color 0ms;
}
& > button:focus {
border-left-color: var(--color-surprise);
}
.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-sm;
}
.sidebar__list .sidebar__list .sidebar__clickable {
padding-left: calc(@padding-sm + @padding-md * 1);
}
.sidebar__list .sidebar__list .sidebar__list .sidebar__clickable {
padding-left: calc(@padding-sm + @padding-md * 2);
}
.sidebar__list .sidebar__list .sidebar__list .sidebar__list .sidebar__clickable {
padding-left: calc(@padding-sm + @padding-md * 3);
}
.sidebar__list .sidebar__list .sidebar__list .sidebar__list .sidebar__list .sidebar__clickable {
padding-left: calc(@padding-sm + @padding-md * 4);
}
.sidebar__list
.sidebar__list
.sidebar__list
.sidebar__list
.sidebar__list
.sidebar__list
.sidebar__clickable {
padding-left: calc(@padding-sm + @padding-md * 5);
}
.sidebar__list
.sidebar__list
.sidebar__list
.sidebar__list
.sidebar__list
.sidebar__list
.sidebar__list
.sidebar__clickable {
padding-left: calc(@padding-sm + @padding-md * 6);
}
// ~~~~~~~~~~~~~~~ //
// Sidebar Actions //
// ~~~~~~~~~~~~~~~ //
.sidebar__actions {
& > * {
height: 100%;
}
& > button,
& > .dropdown > button {
display: none;
color: @hl;
height: 100%;
padding: 0 @padding-sm;
}
& > button:hover,
& .dropdown > button:focus,
& > .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;
}
}