p5.js-web-editor/client/styles/components/_sidebar.scss
Apoorv Taneja f13e806398 Added hover effect on sidebar elements (#887)
* fixes

* changes

* fixes #886, adjusts sidebar styling to match navigation dropdown, move nav dropdown and sidebar dropdowns into common placeholder
2019-07-22 16:07:37 -04:00

266 lines
5.3 KiB
SCSS

.sidebar {
display: flex;
flex-flow: column;
}
.sidebar__header {
padding-right: #{6 / $base-font-size}rem;
padding-left: #{19 / $base-font-size}rem;
display: flex;
justify-content: space-between;
align-items: center;
height: #{29 / $base-font-size}rem;
min-height: #{29 / $base-font-size}rem;
position: relative;
}
.sidebar__title {
font-size: #{12 / $base-font-size}rem;
display: inline-block;
.sidebar--contracted & {
display: none;
}
white-space: nowrap;
overflow: hidden;
}
.sidebar__add {
@include icon();
.sidebar--contracted & {
display: none;
}
& svg {
width: #{10 / $base-font-size}rem;
}
}
.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: auto;
flex: 1 1 auto;
}
.sidebar__file-item {
font-size: #{12 / $base-font-size}rem;
cursor: pointer;
position: relative;
@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');
}
}
}
.sidebar__file-item--folder {
z-index: 1;
}
// 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 {
flex-shrink: 0;
.sidebar__file-item & {
width: #{33 / $base-font-size}rem;
.sidebar__file-item & {
width: #{53 / $base-font-size}rem;
.sidebar__file-item & {
width: #{73 / $base-font-size}rem;
.sidebar__file-item & {
width: #{93 / $base-font-size}rem;
.sidebar__file-item & {
width: #{113 / $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: #{4 / $base-font-size}rem 0;
.sidebar__file-item--editing & {
display: none;
}
&:before {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
content: '';
width: 100%;
}
}
.sidebar__file-item-show-options {
@include icon();
@include themify() {
padding: #{4 / $base-font-size}rem 0;
padding-right: #{6 / $base-font-size}rem;
}
display: none;
position: absolute;
right: 0;
.sidebar__file-item--selected > .file-item__content & {
display: inline-block;
.sidebar--cant-edit & {
display: none;
}
}
.sidebar__file-item:hover > .file-item__content & {
display: inline-block;
.sidebar--cant-edit & {
display: none;
}
}
& svg {
width: #{10 / $base-font-size}rem;
}
.sidebar__file-item--open > .file-item__content & {
display: inline-block;
}
}
.sidebar__file-item-options {
@extend %dropdown-open-right;
display: none;
width: 100%;
max-width: #{180 / $base-font-size}rem;
.sidebar__file-item--open > .file-item__content & {
display: flex;
}
}
.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 icon();
position: absolute;
top: #{7 / $base-font-size}rem;
left: #{1 / $base-font-size}rem;
height: #{14 / $base-font-size}rem;
& svg {
height: #{14 / $base-font-size}rem;
}
display: none;
.sidebar--contracted & {
display: inline-block;
}
}
.sidebar__contract {
@include icon();
position: absolute;
top: #{7 / $base-font-size}rem;
left: #{34 / $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;
height: 100%;
.sidebar--cant-edit & {
display: none;
}
}
.sidebar__folder-icon {
padding: #{4 / $base-font-size}rem 0;
margin-right: #{5 / $base-font-size}rem;
& g {
@include themify() {
fill: map-get($theme-map, 'primary-text-color');
}
}
& svg {
width: #{10 / $base-font-size}rem;
}
}
.sidebar__file-item-icon {
padding: #{4 / $base-font-size}rem 0;
margin-right: #{5 / $base-font-size}rem;
& g {
@include themify() {
fill: getThemifyVariable('inactive-text-color');
}
}
& svg {
height: #{10 / $base-font-size}rem;
}
background-color: transparent;
border: none;
}
.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__file-item--closed .file-item__children {
display: none;
}
.sidebar__project-options {
@extend %dropdown-open-right;
display: none;
width: 100%;
max-width: #{180 / $base-font-size}rem;
.sidebar--project-options & {
display: flex;
}
}