file-tree.less 11 KB

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