file-tree.less 11 KB

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