file-tree.less 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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. &-history {
  40. .entity-name {
  41. padding-left: 6px;
  42. &.deleted {
  43. text-decoration: line-through;
  44. }
  45. }
  46. }
  47. ul.file-tree-list {
  48. margin: 0;
  49. overflow-x: hidden;
  50. height: 100%;
  51. ul {
  52. margin-left: (@line-height-computed / 2);
  53. }
  54. li {
  55. line-height: @file-tree-line-height;
  56. position: relative;
  57. .entity {
  58. user-select: none;
  59. }
  60. .entity-name {
  61. color: @file-tree-item-color;
  62. cursor: pointer;
  63. white-space: nowrap;
  64. overflow: hidden;
  65. text-overflow: ellipsis;
  66. &:hover {
  67. background-color: @file-tree-item-hover-bg;
  68. }
  69. &:hover when (@is-overleaf = true) {
  70. // When the entity is a subfolder, the DOM element is "indented" via margin-left. This makes the
  71. // element not fill the entire file-tree width (as it's spaced from the left-hand side via margin)
  72. // and, in consequence, the background gets clipped. The ::before pseudo-selector is used to fill
  73. // the empty space.
  74. .fake-full-width-bg(@file-tree-item-hover-bg);
  75. }
  76. input {
  77. line-height: 1.6;
  78. }
  79. &.droppable-hover when (@is-overleaf = false) {
  80. background-color: fade(@file-tree-droppable-bg-color, 60%);
  81. }
  82. &.droppable-hover when (@is-overleaf = true) {
  83. background-color: @file-tree-droppable-bg-color;
  84. .fake-full-width-bg(@file-tree-droppable-bg-color);
  85. }
  86. }
  87. i.fa {
  88. color: @file-tree-item-icon-color;
  89. font-size: 14px;
  90. &.linked-file-highlight {
  91. &when (@is-overleaf = true) {
  92. color: white;
  93. }
  94. &when (@is-overleaf = false) {
  95. color: @blue;
  96. }
  97. position: relative;
  98. top: 4px;
  99. left: -8px;
  100. font-size: 12px;
  101. }
  102. }
  103. i.fa-folder-open, i.fa-folder {
  104. color: @file-tree-item-folder-color;
  105. font-size: 14px;
  106. }
  107. i.toggle {
  108. width: 24px;
  109. padding: 6px;
  110. font-size: 0.7rem;
  111. color: @file-tree-item-toggle-color;
  112. }
  113. &.multi-selected {
  114. > .entity > .entity-name when (@is-overleaf = false) {
  115. background-color: @file-tree-multiselect-bg;
  116. &:hover {
  117. background-color: @file-tree-multiselect-hover-bg;
  118. }
  119. }
  120. > .entity when (@is-overleaf = true) {
  121. > .entity-name {
  122. > div > i.fa,
  123. > i.fa,
  124. .entity-menu-toggle i.fa {
  125. color: #FFF;
  126. }
  127. > i.fa i.linked-file-highlight {
  128. color: @blue;
  129. }
  130. color: #FFF;
  131. font-weight: bold;
  132. background-color: @file-tree-multiselect-bg;
  133. .fake-full-width-bg(@file-tree-multiselect-bg);
  134. &:hover {
  135. background-color: @file-tree-multiselect-hover-bg;
  136. .fake-full-width-bg(@file-tree-multiselect-hover-bg);
  137. }
  138. }
  139. }
  140. }
  141. .dropdown {
  142. position: absolute;
  143. right: 0;
  144. > a {
  145. padding: 0 12px;
  146. }
  147. }
  148. .rename-input {
  149. display: block;
  150. position: absolute;
  151. top: 1px;
  152. left: 44px;
  153. right: 32px;
  154. color: @file-tree-item-input-color;
  155. input {
  156. width: 100%;
  157. }
  158. }
  159. > .entity > .entity-name {
  160. .entity-menu-toggle {
  161. display: none;
  162. }
  163. }
  164. }
  165. }
  166. &:not(.multi-selected) {
  167. ul.file-tree-list li.selected {
  168. > .entity > .entity-name when (@is-overleaf = false) {
  169. color: @link-color;
  170. border-right: 4px solid @link-color;
  171. font-weight: bold;
  172. padding-right: 32px;
  173. i.fa-folder-open, i.fa {
  174. color: @link-color;
  175. }
  176. .entity-menu-toggle {
  177. display: inline;
  178. }
  179. }
  180. > .entity when (@is-overleaf = true) {
  181. > .entity-name {
  182. > div > i.fa,
  183. > i.fa,
  184. .entity-menu-toggle i.fa {
  185. color: #FFF;
  186. }
  187. > i.fa i.linked-file-highlight {
  188. color: @blue;
  189. }
  190. background-color: @file-tree-item-selected-bg;
  191. font-weight: bold;
  192. padding-right: 32px;
  193. .fake-full-width-bg(@file-tree-item-selected-bg);
  194. .entity-menu-toggle {
  195. display: inline;
  196. }
  197. }
  198. }
  199. }
  200. }
  201. ul.droppable-hover.file-tree-list when (@is-overleaf = false) {
  202. background-color: fade(@file-tree-droppable-bg-color, 60%);
  203. }
  204. ul.droppable-hover.file-tree-list when (@is-overleaf = true) {
  205. background-color: @file-tree-droppable-bg-color;
  206. .fake-full-width-bg(@file-tree-droppable-bg-color);
  207. }
  208. }
  209. // TODO check if the OL Beta theme is OK with darker themes.
  210. .editor-dark when (@is-overleaf = false) {
  211. aside#file-tree {
  212. // background-color: lighten(@editor-dark-background-color, 10%);
  213. ul.file-tree-list {
  214. .dropdown-toggle {
  215. color: @editor-dark-highlight-color;
  216. }
  217. li {
  218. .entity-name {
  219. color: #aaaaaa;
  220. &:hover {
  221. background-color: black;
  222. }
  223. }
  224. &.selected {
  225. > .entity > .entity-name {
  226. color: @editor-dark-highlight-color;
  227. border-color: @editor-dark-highlight-color;
  228. i.fa-folder-open, i.fa-folder, i.fa-file, i.fa-image, i.fa-file-pdf-o {
  229. color: @editor-dark-highlight-color;
  230. }
  231. }
  232. }
  233. }
  234. }
  235. }
  236. }