file-tree.less 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. .fake-full-width-bg(@bg-color) {
  2. &::before {
  3. content: '\00a0';
  4. position: absolute;
  5. width: 100%;
  6. right: 100%;
  7. background-color: @bg-color;
  8. }
  9. }
  10. #file-tree {
  11. .toolbar.toolbar-filetree {
  12. .toolbar-small-mixin;
  13. .toolbar-alt-mixin;
  14. padding: 0 5px;
  15. }
  16. .file-tree-inner {
  17. position: absolute;
  18. top: 32px;
  19. bottom: 0;
  20. left: 0;
  21. right: 0;
  22. overflow-y: auto;
  23. background-color: @file-tree-bg;
  24. &.no-toolbar {
  25. top: 0;
  26. }
  27. }
  28. // TODO; Consolidate with "Project files" in Overleaf
  29. h3 {
  30. font-size: 1rem;
  31. border-bottom: 1px solid @gray;
  32. padding-bottom: (@line-height-computed / 4);
  33. margin: (@line-height-computed / 2);
  34. }
  35. ul.file-tree-list when (@is-overleaf = false) {
  36. font-size: 0.8rem;
  37. padding: (@line-height-computed / 4) 0;
  38. }
  39. ul.file-tree-list {
  40. margin: 0;
  41. overflow-x: hidden;
  42. height: 100%;
  43. ul {
  44. margin-left: (@line-height-computed / 2);
  45. }
  46. li {
  47. line-height: @file-tree-line-height;
  48. position: relative;
  49. .entity {
  50. user-select: none;
  51. }
  52. .entity-name {
  53. color: @file-tree-item-color;
  54. cursor: pointer;
  55. white-space: nowrap;
  56. overflow: hidden;
  57. text-overflow: ellipsis;
  58. &:hover {
  59. background-color: @file-tree-item-hover-bg;
  60. }
  61. &:hover when (@is-overleaf = true) {
  62. // When the entity is a subfolder, the DOM element is "indented" via margin-left. This makes the
  63. // element not fill the entire file-tree width (as it's spaced from the left-hand side via margin)
  64. // and, in consequence, the background gets clipped. The ::before pseudo-selector is used to fill
  65. // the empty space.
  66. .fake-full-width-bg(@file-tree-item-hover-bg);
  67. }
  68. input {
  69. line-height: 1.6;
  70. }
  71. &.droppable-hover when (@is-overleaf = false) {
  72. background-color: fade(@file-tree-droppable-bg-color, 60%);
  73. }
  74. &.droppable-hover when (@is-overleaf = true) {
  75. background-color: @file-tree-droppable-bg-color;
  76. .fake-full-width-bg(@file-tree-droppable-bg-color);
  77. }
  78. }
  79. i.fa {
  80. color: @file-tree-item-icon-color;
  81. font-size: 14px;
  82. }
  83. i.fa-folder-open, i.fa-folder {
  84. color: @file-tree-item-folder-color;
  85. font-size: 14px;
  86. }
  87. i.toggle {
  88. width: 24px;
  89. padding: 6px;
  90. font-size: 0.7rem;
  91. color: @file-tree-item-toggle-color;
  92. }
  93. &.multi-selected {
  94. > .entity > .entity-name when (@is-overleaf = false) {
  95. background-color: @file-tree-multiselect-bg;
  96. &:hover {
  97. background-color: @file-tree-multiselect-hover-bg;
  98. }
  99. }
  100. > .entity when (@is-overleaf = true) {
  101. > .entity-name {
  102. > div > i.fa,
  103. > i.fa,
  104. .entity-menu-toggle i.fa {
  105. color: #FFF;
  106. }
  107. color: #FFF;
  108. font-weight: bold;
  109. background-color: @file-tree-multiselect-bg;
  110. .fake-full-width-bg(@file-tree-multiselect-bg);
  111. &:hover {
  112. background-color: @file-tree-multiselect-hover-bg;
  113. .fake-full-width-bg(@file-tree-multiselect-hover-bg);
  114. }
  115. }
  116. }
  117. }
  118. .dropdown {
  119. position: absolute;
  120. right: 0;
  121. > a {
  122. padding: 0 12px;
  123. }
  124. }
  125. .rename-input {
  126. display: block;
  127. position: absolute;
  128. top: 1px;
  129. left: 44px;
  130. right: 32px;
  131. color: @file-tree-item-input-color;
  132. input {
  133. width: 100%;
  134. }
  135. }
  136. > .entity > .entity-name {
  137. .entity-menu-toggle {
  138. display: none;
  139. }
  140. }
  141. }
  142. }
  143. &:not(.multi-selected) {
  144. ul.file-tree-list li.selected {
  145. > .entity > .entity-name when (@is-overleaf = false) {
  146. color: @link-color;
  147. border-right: 4px solid @link-color;
  148. font-weight: bold;
  149. padding-right: 32px;
  150. i.fa-folder-open, i.fa {
  151. color: @link-color;
  152. }
  153. .entity-menu-toggle {
  154. display: inline;
  155. }
  156. }
  157. > .entity when (@is-overleaf = true) {
  158. > .entity-name {
  159. > div > i.fa,
  160. > i.fa,
  161. .entity-menu-toggle i.fa {
  162. color: #FFF;
  163. }
  164. background-color: @file-tree-item-selected-bg;
  165. font-weight: bold;
  166. padding-right: 32px;
  167. .fake-full-width-bg(@file-tree-item-selected-bg);
  168. .entity-menu-toggle {
  169. display: inline;
  170. }
  171. }
  172. }
  173. }
  174. }
  175. ul.droppable-hover.file-tree-list when (@is-overleaf = false) {
  176. background-color: fade(@file-tree-droppable-bg-color, 60%);
  177. }
  178. ul.droppable-hover.file-tree-list when (@is-overleaf = true) {
  179. background-color: @file-tree-droppable-bg-color;
  180. .fake-full-width-bg(@file-tree-droppable-bg-color);
  181. }
  182. }
  183. // TODO check if the OL Beta theme is OK with darker themes.
  184. .editor-dark when (@is-overleaf = false) {
  185. aside#file-tree {
  186. // background-color: lighten(@editor-dark-background-color, 10%);
  187. ul.file-tree-list {
  188. .dropdown-toggle {
  189. color: @editor-dark-highlight-color;
  190. }
  191. li {
  192. .entity-name {
  193. color: #aaaaaa;
  194. &:hover {
  195. background-color: black;
  196. }
  197. }
  198. &.selected {
  199. > .entity > .entity-name {
  200. color: @editor-dark-highlight-color;
  201. border-color: @editor-dark-highlight-color;
  202. i.fa-folder-open, i.fa-folder, i.fa-file, i.fa-image, i.fa-file-pdf-o {
  203. color: @editor-dark-highlight-color;
  204. }
  205. }
  206. }
  207. }
  208. }
  209. }
  210. }