file-tree.less 11 KB

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