file-tree.less 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  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. .editor-sidebar {
  11. display: flex;
  12. flex-direction: column;
  13. background-color: @file-tree-bg;
  14. }
  15. .file-tree {
  16. display: flex !important; // To work around jQuery layout's inline styles
  17. flex-direction: column;
  18. flex-grow: 1;
  19. max-height: 100%;
  20. .toolbar.toolbar-filetree {
  21. .toolbar-small-mixin;
  22. .toolbar-alt-mixin;
  23. padding: 0 5px;
  24. flex-shrink: 0;
  25. }
  26. > file-tree-root,
  27. .file-tree-inner {
  28. position: relative;
  29. display: flex;
  30. flex-direction: column;
  31. flex-grow: 1;
  32. overflow-y: auto;
  33. width: inherit;
  34. height: inherit;
  35. &.no-toolbar {
  36. top: 0;
  37. }
  38. }
  39. // TODO; Consolidate with "Project files" in Overleaf
  40. h3 {
  41. font-size: 1rem;
  42. border-bottom: 1px solid @gray;
  43. padding-bottom: (@line-height-computed / 4);
  44. margin: (@line-height-computed / 2);
  45. }
  46. &-history {
  47. .entity-name {
  48. padding-left: 6px;
  49. &.deleted {
  50. text-decoration: line-through;
  51. }
  52. }
  53. .loading {
  54. padding-left: 6px;
  55. color: #fff;
  56. i.fa {
  57. color: #fff;
  58. }
  59. }
  60. }
  61. li.dnd-droppable-hover .entity-name,
  62. li .entity-name.droppable-hover {
  63. font-weight: bold;
  64. background-color: @file-tree-item-hover-bg;
  65. .fake-full-width-bg(@file-tree-item-hover-bg);
  66. }
  67. ul.droppable-hover li div.entity-name:hover {
  68. background-color: transparent;
  69. .fake-full-width-bg(transparent);
  70. &.droppable-hover {
  71. background-color: @file-tree-item-hover-bg;
  72. .fake-full-width-bg(@file-tree-item-hover-bg);
  73. }
  74. }
  75. ul.file-tree-list {
  76. margin: 0;
  77. overflow-x: hidden;
  78. height: 100%;
  79. flex-grow: 1;
  80. position: relative;
  81. overflow-y: auto;
  82. .entity > ul,
  83. ul[role='tree'] {
  84. margin-left: (@line-height-computed / 2);
  85. }
  86. li.bottom-buffer {
  87. min-height: @line-height-computed;
  88. }
  89. li {
  90. line-height: @file-tree-line-height;
  91. position: relative;
  92. &:focus {
  93. outline: none;
  94. }
  95. .entity {
  96. user-select: none;
  97. &:focus {
  98. outline: none;
  99. }
  100. }
  101. .entity > .entity-name > button {
  102. background-color: transparent;
  103. border: 0;
  104. padding: 0;
  105. &:focus {
  106. outline: none;
  107. }
  108. &.item-name-button {
  109. width: 100%;
  110. overflow: hidden;
  111. text-overflow: ellipsis;
  112. text-align: left;
  113. padding-right: 32px;
  114. }
  115. }
  116. .entity-name {
  117. color: @file-tree-item-color;
  118. cursor: pointer;
  119. white-space: nowrap;
  120. overflow: hidden;
  121. text-overflow: ellipsis;
  122. &.entity-name-react {
  123. text-overflow: clip;
  124. }
  125. &:focus {
  126. outline: none;
  127. }
  128. &:hover {
  129. background-color: @file-tree-item-hover-bg;
  130. }
  131. &:hover {
  132. // When the entity is a subfolder, the DOM element is "indented" via margin-left. This makes the
  133. // element not fill the entire file-tree width (as it's spaced from the left-hand side via margin)
  134. // and, in consequence, the background gets clipped. The ::before pseudo-selector is used to fill
  135. // the empty space.
  136. .fake-full-width-bg(@file-tree-item-hover-bg);
  137. }
  138. input {
  139. line-height: 1.6;
  140. }
  141. .entity-menu-toggle > i {
  142. color: white;
  143. font-size: 18px;
  144. }
  145. }
  146. .entity.dnd-draggable-dragging {
  147. .entity-name:hover {
  148. background-color: transparent;
  149. .fake-full-width-bg(transparent);
  150. }
  151. }
  152. i.fa {
  153. color: @file-tree-item-icon-color;
  154. font-size: 14px;
  155. &.linked-file-highlight {
  156. & {
  157. color: white;
  158. }
  159. position: relative;
  160. top: 4px;
  161. left: -8px;
  162. font-size: 12px;
  163. }
  164. }
  165. i.fa-folder-open,
  166. i.fa-folder {
  167. color: @file-tree-item-folder-color;
  168. font-size: 14px;
  169. }
  170. i.spaced {
  171. margin-left: 18px;
  172. }
  173. i.toggle {
  174. width: 24px;
  175. padding: 6px;
  176. font-size: 16px;
  177. color: @file-tree-item-toggle-color;
  178. }
  179. .file-tree-dropdown-toggle {
  180. display: flex;
  181. align-items: center;
  182. color: #fff;
  183. line-height: 1.6;
  184. font-size: 20px;
  185. padding: 0 4px 0 18px;
  186. &:hover,
  187. &:focus {
  188. text-decoration: none;
  189. }
  190. &::before {
  191. content: '\00B7\00B7\00B7';
  192. transform: rotate(90deg);
  193. letter-spacing: 0.5px;
  194. }
  195. }
  196. &.multi-selected {
  197. > .entity {
  198. > .entity-name {
  199. > div > i.fa,
  200. > button > i.fa,
  201. > i.fa,
  202. .entity-menu-toggle i.fa {
  203. color: #fff;
  204. }
  205. > i.fa i.linked-file-highlight {
  206. color: @blue;
  207. }
  208. color: #fff;
  209. font-weight: bold;
  210. background-color: @file-tree-multiselect-bg;
  211. .fake-full-width-bg(@file-tree-multiselect-bg);
  212. &:hover {
  213. background-color: @file-tree-multiselect-hover-bg;
  214. .fake-full-width-bg(@file-tree-multiselect-hover-bg);
  215. }
  216. }
  217. }
  218. }
  219. .menu-button {
  220. position: absolute;
  221. right: 0;
  222. }
  223. .rename-input {
  224. display: block;
  225. position: absolute;
  226. top: 1px;
  227. left: 44px;
  228. right: 32px;
  229. color: @file-tree-item-input-color;
  230. input {
  231. width: 100%;
  232. }
  233. }
  234. > .entity > .entity-name {
  235. .entity-menu-toggle {
  236. display: none;
  237. }
  238. }
  239. .entity-limit-hit {
  240. color: @file-tree-item-color;
  241. line-height: 2.05;
  242. margin-left: (@line-height-computed / 2);
  243. white-space: nowrap;
  244. overflow: hidden;
  245. text-overflow: ellipsis;
  246. }
  247. .entity-limit-hit-message {
  248. font-style: italic;
  249. }
  250. i.fa.entity-limit-hit-tooltip-trigger {
  251. margin-left: (@line-height-computed / 4);
  252. cursor: pointer;
  253. }
  254. }
  255. }
  256. &:not(.multi-selected) {
  257. ul.file-tree-list li.selected {
  258. > .entity {
  259. > .entity-name {
  260. color: @file-tree-item-selected-color;
  261. > div > i.fa,
  262. > button > i.fa,
  263. > i.fa,
  264. .entity-menu-toggle i.fa {
  265. color: @file-tree-item-selected-color;
  266. }
  267. > i.fa i.linked-file-highlight {
  268. color: @blue;
  269. }
  270. background-color: @file-tree-item-selected-bg;
  271. font-weight: bold;
  272. padding-right: 32px;
  273. .fake-full-width-bg(@file-tree-item-selected-bg);
  274. .entity-menu-toggle {
  275. display: inline-block;
  276. background-color: transparent;
  277. box-shadow: none;
  278. border: 0;
  279. }
  280. }
  281. }
  282. }
  283. ul.file-tree-list li.selected.dnd-droppable-hover {
  284. > .entity {
  285. > .entity-name {
  286. background-color: @file-tree-item-hover-bg;
  287. .fake-full-width-bg(@file-tree-item-hover-bg);
  288. }
  289. }
  290. }
  291. }
  292. .dnd-draggable-preview-layer {
  293. position: absolute;
  294. pointer-events: none;
  295. z-index: 100;
  296. width: 100%;
  297. height: 100%;
  298. overflow: hidden;
  299. &.dnd-droppable-hover {
  300. border: 3px solid @file-tree-item-selected-bg;
  301. }
  302. }
  303. .dnd-draggable-preview-item,
  304. .ui-draggable-dragging {
  305. background-color: fade(@file-tree-item-selected-bg, 60%);
  306. color: @file-tree-item-selected-color;
  307. width: 75%;
  308. padding-left: @line-height-computed;
  309. }
  310. .dnd-draggable-preview-item {
  311. line-height: @file-tree-line-height;
  312. overflow: hidden;
  313. text-overflow: ellipsis;
  314. white-space: nowrap;
  315. }
  316. .disconnected-overlay {
  317. position: absolute;
  318. top: 0;
  319. left: 0;
  320. width: 100%;
  321. height: 100%;
  322. z-index: 10;
  323. background: @file-tree-bg;
  324. opacity: 0.5;
  325. cursor: wait;
  326. }
  327. }
  328. .modal-new-file {
  329. padding: 0;
  330. table {
  331. width: 100%;
  332. td {
  333. vertical-align: top;
  334. }
  335. }
  336. /* old modal */
  337. .toggle-output-files-button {
  338. font-size: 80%;
  339. }
  340. /* new modal */
  341. .toggle-file-type-button {
  342. font-size: 80%;
  343. margin-top: -12px;
  344. .btn {
  345. display: inline-block;
  346. padding: 0;
  347. vertical-align: baseline;
  348. font-size: inherit;
  349. }
  350. .btn:focus-within {
  351. outline: none;
  352. text-decoration: none;
  353. }
  354. }
  355. }
  356. .modal-new-file--list {
  357. background-color: @modal-footer-background-color;
  358. width: 220px;
  359. ul {
  360. li {
  361. /* old modal (a) */
  362. a {
  363. color: @text-color;
  364. padding: (@line-height-computed / 4);
  365. display: block;
  366. text-decoration: none;
  367. }
  368. /* new modal (button) */
  369. .btn {
  370. color: @text-color;
  371. padding: (@line-height-computed / 4);
  372. }
  373. .btn:hover {
  374. text-decoration: none;
  375. }
  376. .btn:focus {
  377. outline: none;
  378. text-decoration: none;
  379. background-color: white;
  380. }
  381. }
  382. li.active {
  383. background-color: white;
  384. /* old modal (a) */
  385. a {
  386. color: @link-color;
  387. }
  388. /* new modal (button) */
  389. .btn {
  390. color: @link-color;
  391. text-decoration: none;
  392. }
  393. }
  394. li:hover {
  395. background-color: white;
  396. }
  397. }
  398. }
  399. .file-tree-error {
  400. text-align: center;
  401. color: @file-tree-error-color;
  402. padding: 20px;
  403. }
  404. .file-tree-modal-alert {
  405. margin-top: 10px;
  406. margin-bottom: 0px;
  407. }
  408. .btn.modal-new-file-mode {
  409. text-align: left;
  410. }
  411. .modal-new-file--body {
  412. padding: 20px;
  413. padding-top: (@line-height-computed / 4);
  414. }
  415. .modal-new-file--body-upload {
  416. padding-top: 20px;
  417. }
  418. .modal-footer {
  419. .approaching-file-limit {
  420. font-weight: bold;
  421. }
  422. .at-file-limit {
  423. text-align: left;
  424. }
  425. }
  426. .modal-new-file--body-upload .uppy-Root {
  427. font-family: inherit;
  428. }
  429. .modal-new-file--body-upload .uppy-size--md {
  430. .uppy-Dashboard-AddFiles-title {
  431. font-size: inherit;
  432. }
  433. }