file-tree.less 7.7 KB

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