file-tree.less 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  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. .toggle-output-files-button {
  334. font-size: 80%;
  335. }
  336. }
  337. .modal-new-file--list {
  338. background-color: @modal-footer-background-color;
  339. width: 220px;
  340. ul {
  341. li {
  342. a {
  343. color: @text-color;
  344. padding: (@line-height-computed / 4);
  345. display: block;
  346. text-decoration: none;
  347. }
  348. }
  349. li.active {
  350. background-color: white;
  351. a {
  352. color: @link-color;
  353. }
  354. }
  355. li:hover {
  356. background-color: white;
  357. }
  358. }
  359. }
  360. .file-tree-error {
  361. text-align: center;
  362. color: @file-tree-error-color;
  363. padding: 20px;
  364. }
  365. .file-tree-modal-alert {
  366. margin-top: 10px;
  367. margin-bottom: 0px;
  368. }
  369. .modal-new-file--body {
  370. padding: 20px;
  371. padding-top: (@line-height-computed / 4);
  372. }
  373. .modal-new-file--body-upload {
  374. padding-top: 20px;
  375. }
  376. .modal-footer {
  377. .approaching-file-limit {
  378. font-weight: bold;
  379. }
  380. .at-file-limit {
  381. text-align: left;
  382. }
  383. }