file-tree.less 10 KB

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