file-tree.less 11 KB

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