file-tree.less 6.3 KB

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