file-tree.less 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  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. 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. ul.file-tree-list {
  62. margin: 0;
  63. overflow-x: hidden;
  64. height: 100%;
  65. flex-grow: 1;
  66. position: relative;
  67. overflow-y: auto;
  68. .entity > ul,
  69. ul[role='tree'] {
  70. margin-left: 22px;
  71. }
  72. &::after {
  73. content: '';
  74. display: block;
  75. min-height: @line-height-computed;
  76. }
  77. li {
  78. line-height: @file-tree-line-height;
  79. position: relative;
  80. &:focus {
  81. outline: none;
  82. }
  83. .entity {
  84. user-select: none;
  85. &:focus {
  86. outline: none;
  87. }
  88. }
  89. .entity > .entity-name > button {
  90. background-color: transparent;
  91. border: 0;
  92. padding: 0;
  93. &:focus {
  94. outline: none;
  95. }
  96. &.item-name-button {
  97. width: 100%;
  98. overflow: hidden;
  99. text-overflow: ellipsis;
  100. text-align: left;
  101. padding-right: 32px;
  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. td {
  353. vertical-align: top;
  354. }
  355. }
  356. /* old modal */
  357. .toggle-output-files-button {
  358. font-size: 80%;
  359. }
  360. /* new modal */
  361. .toggle-file-type-button {
  362. font-size: 80%;
  363. margin-top: -12px;
  364. .btn {
  365. display: inline-block;
  366. padding: 0;
  367. vertical-align: baseline;
  368. font-size: inherit;
  369. }
  370. .btn:focus-within {
  371. outline: none;
  372. text-decoration: none;
  373. }
  374. }
  375. }
  376. .modal-new-file--list {
  377. background-color: @modal-footer-background-color;
  378. width: 220px;
  379. ul {
  380. li {
  381. /* old modal (a) */
  382. a {
  383. color: @text-color;
  384. padding: (@line-height-computed / 4);
  385. display: block;
  386. text-decoration: none;
  387. }
  388. /* new modal (button) */
  389. .btn {
  390. color: @text-color;
  391. padding: (@line-height-computed / 4);
  392. }
  393. .btn:hover {
  394. text-decoration: none;
  395. }
  396. .btn:focus {
  397. outline: none;
  398. text-decoration: none;
  399. background-color: white;
  400. }
  401. }
  402. li.active {
  403. background-color: white;
  404. /* old modal (a) */
  405. a {
  406. color: @link-color;
  407. }
  408. /* new modal (button) */
  409. .btn {
  410. color: @link-color;
  411. text-decoration: none;
  412. }
  413. }
  414. li:hover {
  415. background-color: white;
  416. }
  417. }
  418. }
  419. .file-tree-error {
  420. text-align: center;
  421. color: @file-tree-error-color;
  422. padding: 20px;
  423. }
  424. .file-tree-modal-alert {
  425. margin-top: 10px;
  426. margin-bottom: 0px;
  427. }
  428. .btn.modal-new-file-mode {
  429. text-align: left;
  430. }
  431. .modal-new-file--body {
  432. padding: 20px;
  433. padding-top: (@line-height-computed / 4);
  434. }
  435. .modal-new-file--body-upload {
  436. padding-top: 20px;
  437. }
  438. .modal-new-file--body-conflict {
  439. background-color: @red-10;
  440. border: 1px dashed @red-50;
  441. min-height: 400px;
  442. border-radius: 3px;
  443. color: @neutral-90;
  444. display: flex;
  445. flex-direction: column;
  446. justify-content: center;
  447. padding: @padding-sm;
  448. }
  449. .modal-footer {
  450. .approaching-file-limit {
  451. font-weight: bold;
  452. }
  453. .at-file-limit {
  454. text-align: left;
  455. }
  456. }
  457. .modal-new-file--body-upload .uppy-Root {
  458. font-family: inherit;
  459. }
  460. .modal-new-file--body-upload .uppy-Dashboard {
  461. .uppy-Dashboard-inner {
  462. border: none;
  463. }
  464. .uppy-Dashboard-dropFilesHereHint {
  465. top: 0;
  466. bottom: 0;
  467. left: 0;
  468. right: 0;
  469. }
  470. .uppy-Dashboard-AddFiles {
  471. margin: 0;
  472. border: 1px dashed @neutral-60;
  473. height: 100%;
  474. .uppy-Dashboard-AddFiles-title {
  475. font-size: inherit;
  476. }
  477. }
  478. }