p5.js-web-editor/client/styles/components/_sidebar.scss
2016-09-03 20:29:18 -04:00

200 lines
4 KiB
SCSS

.sidebar__header {
padding: #{10 / $base-font-size}rem #{6 / $base-font-size}rem;
display: flex;
justify-content: space-between;
border-top: 1px solid $ide-border-color;
align-items: center;
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 {
@extend %icon;
cursor: pointer;
// height: #{26 / $base-font-size}rem;
// margin-right: #{16 / $base-font-size}rem;
// font-size: #{24 / $base-font-size}rem;
.sidebar--contracted & {
display: none;
}
}
.sidebar__file-list {
border-top: 1px solid $ide-border-color;
.sidebar--contracted & {
display: none;
}
}
.sidebar__root-item {
position: relative;
}
.sidebar__file-item {
font-size: #{16 / $base-font-size}rem;
color: $light-inactive-text-color;
cursor: pointer;
&:hover > .file-item__content .sidebar__file-item-name {
color: $light-primary-text-color;
}
&:hover > .file-item__content .sidebar__file-item-icon g {
fill: $light-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;
padding: #{8 / $base-font-size}rem 0;
.sidebar__file-item--selected > & {
background-color: $ide-border-color;
}
.sidebar--contracted & {
display: none;
}
}
.sidebar__file-item-name {
.sidebar__file-item--editing & {
display: none;
}
}
.sidebar__file-item-show-options {
@extend %icon;
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;
position: absolute;
top: 95%;
left: 77%;
right: -65%;
display: none;
z-index: 100;
padding: #{8 / $base-font-size}rem #{16 / $base-font-size}rem;
background-color: $light-modal-background-color;
z-index: 100;
.sidebar__file-item--open > .file-item__content & {
display: block;
}
}
.sidebar__file-item-input {
display: none;
padding: 0;
border: 0;
background-color: transparent;
max-width: 90%;
.sidebar__file-item--editing & {
display: inline-block;
}
}
.sidebar__contract {
@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__expand {
@extend %icon;
height: #{14 / $base-font-size}rem;
& svg {
height: #{14 / $base-font-size}rem;
}
display: none;
.sidebar--contracted & {
display: inline-block;
}
}
.sidebar__icons {
display: flex;
align-items: center;
position: relative;
}
.sidebar__folder-icon {
margin-right: #{5 / $base-font-size}rem;
& g {
fill: $light-primary-text-color;
}
}
.sidebar__file-item-icon {
margin-right: #{5 / $base-font-size}rem;
}
.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;
.sidebar__file-item--closed & {
display: none;
}
}
.sidebar__project-options {
@extend %modal;
display: none;
position: absolute;
.sidebar--project-options & {
display: block;
}
top: 100%;
padding: #{8 / $base-font-size}rem;
width: #{110 / $base-font-size}rem;
}
.sidebar__file-item--closed .file-item__children {
display: none;
}