file-tree.less 11 KB

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