file-tree.less 10 KB

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