file-tree.less 11 KB

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