file-tree.less 6.7 KB

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