file-tree.less 8.6 KB

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