p5.js-web-editor/client/styles/components/_sidebar.scss
Cassie Tarakajian 637a62be01 fix sidebar bugs
2016-12-09 17:05:24 -05:00

235 lines
4.8 KiB
SCSS

.sidebar {
@include themify() {
border: 1px solid map-get($theme-map, 'ide-border-color');
}
display: flex;
flex-flow: column;
}
.sidebar__header {
padding: #{10 / $base-font-size}rem #{6 / $base-font-size}rem;
display: flex;
justify-content: space-between;
align-items: center;
height: #{47 / $base-font-size}rem;
min-height: #{47 / $base-font-size}rem;
}
.sidebar__title {
font-size: #{16 / $base-font-size}rem;
display: inline-block;
.sidebar--contracted & {
display: none;
}
white-space: nowrap;
overflow: hidden;
}
.sidebar__add {
@include themify() {
@extend %icon;
}
.sidebar--contracted & {
display: none;
}
}
.sidebar__file-list {
@include themify() {
border-color: getThemifyVariable('ide-border-color')
}
border-top: 1px solid;
.sidebar--contracted & {
display: none;
}
}
.sidebar__root-item {
position: relative;
overflow-y: scroll;
flex: 1 1 auto;
}
.sidebar__file-item {
font-size: #{16 / $base-font-size}rem;
cursor: pointer;
@include themify() {
color: map-get($theme-map, 'inactive-text-color');
&:hover > .file-item__content .sidebar__file-item-name {
color: map-get($theme-map, 'primary-text-color');
}
&:hover > .file-item__content .sidebar__file-item-icon g {
fill: map-get($theme-map, 'primary-text-color');
}
}
}
// to indent each row in the file tree
// not sure how to do this in a better way
// it won't work if the file tree is too nested
.file-item__spacer {
.sidebar__file-item & {
width: #{20 / $base-font-size}rem;
.sidebar__file-item & {
width: #{40 / $base-font-size}rem;
.sidebar__file-item & {
width: #{60 / $base-font-size}rem;
.sidebar__file-item & {
width: #{80 / $base-font-size}rem;
.sidebar__file-item & {
width: #{100 / $base-font-size}rem;
}
}
}
}
}
}
.file-item__content {
display: flex;
position: relative;
.sidebar__file-item--selected > & {
@include themify() {
background-color: map-get($theme-map, 'file-selected-color');
}
}
.sidebar--contracted & {
display: none;
}
}
.sidebar__file-item-name {
padding: #{8 / $base-font-size}rem 0;
.sidebar__file-item--editing & {
display: none;
}
}
.sidebar__file-item-show-options {
@include themify() {
@extend %icon;
padding: #{8 / $base-font-size}rem 0;
}
display: none;
position: absolute;
right: #{26 / $base-font-size}rem;
.sidebar__file-item--selected > .file-item__content & {
display: inline-block;
}
}
.sidebar__file-item-options {
@extend %modal;
@include themify() {
background-color: getThemifyVariable('modal-background-color');
}
position: absolute;
top: 95%;
left: #{15 / $base-font-size}rem;
right: #{15 / $base-font-size}rem;
display: none;
z-index: 100;
padding: #{8 / $base-font-size}rem #{16 / $base-font-size}rem;
z-index: 100;
.sidebar__file-item--open > .file-item__content & {
display: block;
}
}
.sidebar__file-item-input {
display: none;
padding: 0;
border: 0;
width: calc(100% - #{100 / $base-font-size}rem);
.sidebar__file-item--editing & {
display: inline-block;
}
}
.sidebar__expand {
@include themify() {
@extend %icon;
}
height: #{14 / $base-font-size}rem;
& svg {
height: #{14 / $base-font-size}rem;
}
display: none;
.sidebar--contracted & {
display: inline-block;
}
}
.sidebar__contract {
@include themify() {
@extend %icon;
}
margin-left: #{10 / $base-font-size}rem;
height: #{14 / $base-font-size}rem;
& svg {
height: #{14 / $base-font-size}rem;
}
.sidebar--contracted & {
display: none;
}
}
.sidebar__icons {
display: flex;
align-items: center;
position: relative;
}
.sidebar__folder-icon {
padding: #{8 / $base-font-size}rem 0;
margin-right: #{5 / $base-font-size}rem;
& g {
@include themify() {
fill: map-get($theme-map, 'primary-text-color');
}
}
}
.sidebar__file-item-icon {
padding: #{8 / $base-font-size}rem 0;
margin-right: #{5 / $base-font-size}rem;
& g {
@include themify() {
fill: getThemifyVariable('inactive-text-color');
}
}
}
.sidebar__file-item-closed {
@extend .sidebar__file-item-icon;
display: none;
.sidebar__file-item--closed & {
display: inline-block;
}
}
.sidebar__file-item-open {
@extend .sidebar__file-item-icon;
display: inline-block;
.sidebar__file-item--closed & {
display: none;
}
}
.sidebar__project-options {
@extend %modal;
display: none;
position: absolute;
.sidebar--project-options & {
display: block;
}
top: 100%;
right: #{-70 / $base-font-size}rem;
padding: #{8 / $base-font-size}rem;
width: #{110 / $base-font-size}rem;
}
.sidebar__file-item--closed .file-item__children {
display: none;
}