overleaf/services/web/frontend/stylesheets/app/editor/file-tree.less

333 lines
6.7 KiB
Text
Raw Normal View History

.fake-full-width-bg(@bg-color) {
&::before {
content: '\00a0';
position: absolute;
width: 100%;
right: 100%;
background-color: @bg-color;
}
}
2014-06-26 11:39:52 -04:00
.file-tree {
.toolbar.toolbar-filetree {
.toolbar-small-mixin;
.toolbar-alt-mixin;
padding: 0 5px;
}
2014-06-27 12:11:26 -04:00
.file-tree-inner {
2014-06-26 11:39:52 -04:00
position: absolute;
top: 32px;
bottom: 0;
left: 0;
right: 0;
overflow-y: auto;
2017-11-20 07:24:00 -05:00
background-color: @file-tree-bg;
&.no-toolbar {
top: 0;
}
2014-06-27 12:11:26 -04:00
}
2017-11-21 06:45:06 -05:00
// TODO; Consolidate with "Project files" in Overleaf
2014-06-27 12:11:26 -04:00
h3 {
font-size: 1rem;
border-bottom: 1px solid @gray;
padding-bottom: (@line-height-computed / 4);
margin: (@line-height-computed / 2);
}
2017-11-20 07:24:00 -05:00
ul.file-tree-list when (@is-overleaf = false) {
2014-06-27 12:11:26 -04:00
font-size: 0.8rem;
padding: (@line-height-computed / 4) 0;
2017-11-20 07:24:00 -05:00
}
&-history {
.entity-name {
padding-left: 6px;
&.deleted {
text-decoration: line-through;
}
}
.loading {
padding-left: 6px;
color: #FFF;
i.fa {
color: #FFF;
}
}
}
li .entity-name.droppable-hover when (@is-overleaf = true) {
font-weight: bold;
background-color: @file-tree-item-hover-bg;
.fake-full-width-bg(@file-tree-item-hover-bg);
}
li .entity-name.droppable-hover when (@is-overleaf-light = true) {
// color: @file-tree-item-selected-color;
}
ul.droppable-hover li div.entity-name:hover when (@is-overleaf = true) {
background-color: transparent;
.fake-full-width-bg(transparent);
&.droppable-hover {
background-color: @file-tree-item-hover-bg;
.fake-full-width-bg(@file-tree-item-hover-bg);
}
}
2017-11-20 07:24:00 -05:00
ul.file-tree-list {
margin: 0;
overflow-x: hidden;
height: 100%;
2014-06-26 11:39:52 -04:00
2017-11-28 06:27:45 -05:00
ul {
2014-06-26 11:39:52 -04:00
margin-left: (@line-height-computed / 2);
}
li {
2017-12-05 05:07:45 -05:00
line-height: @file-tree-line-height;
position: relative;
2014-06-26 11:39:52 -04:00
.entity {
user-select: none;
}
2014-06-26 11:39:52 -04:00
.entity-name {
2017-11-20 07:24:00 -05:00
color: @file-tree-item-color;
2014-06-26 11:39:52 -04:00
cursor: pointer;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
&:hover {
2017-11-20 07:24:00 -05:00
background-color: @file-tree-item-hover-bg;
2014-06-26 11:39:52 -04:00
}
&:hover when (@is-overleaf = true) {
// When the entity is a subfolder, the DOM element is "indented" via margin-left. This makes the
// element not fill the entire file-tree width (as it's spaced from the left-hand side via margin)
// and, in consequence, the background gets clipped. The ::before pseudo-selector is used to fill
// the empty space.
.fake-full-width-bg(@file-tree-item-hover-bg);
}
2014-06-26 11:39:52 -04:00
input {
line-height: 1.6;
}
&.droppable-hover when (@is-overleaf = false) {
background-color: fade(@file-tree-droppable-bg-color, 60%);
2014-06-26 11:39:52 -04:00
}
}
i.fa {
color: @file-tree-item-icon-color;
2014-06-26 11:39:52 -04:00
font-size: 14px;
2018-02-20 05:37:55 -05:00
&.linked-file-highlight {
&when (@is-overleaf = true) {
color: white;
}
&when (@is-overleaf = false) {
color: @blue;
}
position: relative;
top: 4px;
left: -8px;
font-size: 12px;
}
2014-06-26 11:39:52 -04:00
}
i.fa-folder-open, i.fa-folder {
color: @file-tree-item-folder-color;
2014-06-26 11:39:52 -04:00
font-size: 14px;
}
i.toggle {
width: 24px;
padding: 6px;
font-size: 0.7rem;
color: @file-tree-item-toggle-color;
2014-06-26 11:39:52 -04:00
}
&.multi-selected {
2017-11-21 06:45:06 -05:00
> .entity > .entity-name when (@is-overleaf = false) {
background-color: @file-tree-multiselect-bg;
&:hover {
2017-11-21 06:45:06 -05:00
background-color: @file-tree-multiselect-hover-bg;
}
}
> .entity when (@is-overleaf = true) {
> .entity-name {
2017-11-21 11:10:07 -05:00
> div > i.fa,
> i.fa,
.entity-menu-toggle i.fa {
color: #FFF;
}
2018-02-20 05:37:55 -05:00
> i.fa i.linked-file-highlight {
color: @blue;
}
2017-11-21 11:10:07 -05:00
color: #FFF;
font-weight: bold;
2017-11-21 06:45:06 -05:00
background-color: @file-tree-multiselect-bg;
.fake-full-width-bg(@file-tree-multiselect-bg);
2017-11-21 06:45:06 -05:00
&:hover {
background-color: @file-tree-multiselect-hover-bg;
.fake-full-width-bg(@file-tree-multiselect-hover-bg);
2017-11-21 06:45:06 -05:00
}
2014-06-26 11:39:52 -04:00
}
}
}
.dropdown {
position: absolute;
right: 0;
> a {
padding: 0 12px;
}
}
.rename-input {
display: block;
position: absolute;
top: 1px;
left: 44px;
right: 32px;
color: @file-tree-item-input-color;
input {
width: 100%;
}
}
> .entity > .entity-name {
.entity-menu-toggle {
display: none;
}
}
}
}
&:not(.multi-selected) {
ul.file-tree-list li.selected {
2017-11-20 07:24:00 -05:00
> .entity > .entity-name when (@is-overleaf = false) {
color: @link-color;
border-right: 4px solid @link-color;
font-weight: bold;
padding-right: 32px;
i.fa-folder-open, i.fa {
color: @link-color;
}
.entity-menu-toggle {
display: inline;
}
}
2017-11-20 07:24:00 -05:00
> .entity when (@is-overleaf = true) {
> .entity-name {
2018-07-09 10:45:09 -04:00
color: @file-tree-item-selected-color;
2017-11-21 11:10:07 -05:00
> div > i.fa,
> i.fa,
.entity-menu-toggle i.fa {
2018-07-09 10:45:09 -04:00
color: @file-tree-item-selected-color;
2017-11-21 11:10:07 -05:00
}
2018-02-20 05:37:55 -05:00
> i.fa i.linked-file-highlight {
color: @blue;
}
background-color: @file-tree-item-selected-bg;
2017-11-21 11:10:07 -05:00
font-weight: bold;
padding-right: 32px;
.fake-full-width-bg(@file-tree-item-selected-bg);
2017-11-20 07:24:00 -05:00
.entity-menu-toggle {
display: inline;
}
}
}
2014-06-26 11:39:52 -04:00
}
}
ul.droppable-hover.file-tree-list when (@is-overleaf = false) {
background-color: fade(@file-tree-droppable-bg-color, 60%);
}
.ui-draggable-dragging when (@is-overleaf = true) {
background-color: fade(@file-tree-item-selected-bg, 60%);
color: @file-tree-item-selected-color;
width: 75%;
padding-left: @line-height-computed;
2014-06-26 11:39:52 -04:00
}
2014-07-11 08:55:14 -04:00
}
2017-11-21 11:10:07 -05:00
// TODO check if the OL Beta theme is OK with darker themes.
.editor-dark when (@is-overleaf = false) {
aside#file-tree {
// background-color: lighten(@editor-dark-background-color, 10%);
ul.file-tree-list {
.dropdown-toggle {
color: @editor-dark-highlight-color;
}
li {
.entity-name {
color: #aaaaaa;
&:hover {
background-color: black;
}
}
&.selected {
> .entity > .entity-name {
color: @editor-dark-highlight-color;
border-color: @editor-dark-highlight-color;
i.fa-folder-open, i.fa-folder, i.fa-file, i.fa-image, i.fa-file-pdf-o {
color: @editor-dark-highlight-color;
}
}
}
}
}
}
}
.modal-new-file {
padding: 0;
table {
width: 100%;
td {
vertical-align: top;
}
}
.toggle-output-files-button {
font-size: 80%;
}
}
.modal-new-file--list {
background-color: @modal-footer-background-color;
width: 220px;
ul {
li {
a {
color: @text-color;
padding: (@line-height-computed / 4);
display: block;
text-decoration: none;
}
}
li.active {
background-color: white;
a {
color: @link-color;
}
}
li:hover {
background-color: white;
}
}
}
.modal-new-file--body {
padding: 20px;
padding-top: (@line-height-computed / 4);
}
.modal-new-file--body-upload {
padding-top: 20px;
}