file-tree.less 9.8 KB

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