file-tree.less 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  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-inner {
  27. display: flex;
  28. flex-direction: column;
  29. flex-grow: 1;
  30. overflow-y: auto;
  31. &.no-toolbar {
  32. top: 0;
  33. }
  34. }
  35. // TODO; Consolidate with "Project files" in Overleaf
  36. h3 {
  37. font-size: 1rem;
  38. border-bottom: 1px solid @gray;
  39. padding-bottom: (@line-height-computed / 4);
  40. margin: (@line-height-computed / 2);
  41. }
  42. &-history {
  43. .entity-name {
  44. padding-left: 6px;
  45. &.deleted {
  46. text-decoration: line-through;
  47. }
  48. }
  49. .loading {
  50. padding-left: 6px;
  51. color: #fff;
  52. i.fa {
  53. color: #fff;
  54. }
  55. }
  56. }
  57. li .entity-name.droppable-hover {
  58. font-weight: bold;
  59. background-color: @file-tree-item-hover-bg;
  60. .fake-full-width-bg(@file-tree-item-hover-bg);
  61. }
  62. ul.droppable-hover li div.entity-name:hover {
  63. background-color: transparent;
  64. .fake-full-width-bg(transparent);
  65. &.droppable-hover {
  66. background-color: @file-tree-item-hover-bg;
  67. .fake-full-width-bg(@file-tree-item-hover-bg);
  68. }
  69. }
  70. ul.file-tree-list {
  71. margin: 0;
  72. overflow-x: hidden;
  73. height: 100%;
  74. flex-grow: 1;
  75. position: relative;
  76. overflow-y: auto;
  77. ul {
  78. margin-left: (@line-height-computed / 2);
  79. }
  80. li {
  81. line-height: @file-tree-line-height;
  82. position: relative;
  83. .entity {
  84. user-select: none;
  85. }
  86. .entity-name {
  87. color: @file-tree-item-color;
  88. cursor: pointer;
  89. white-space: nowrap;
  90. overflow: hidden;
  91. text-overflow: ellipsis;
  92. &:hover {
  93. background-color: @file-tree-item-hover-bg;
  94. }
  95. &:hover {
  96. // When the entity is a subfolder, the DOM element is "indented" via margin-left. This makes the
  97. // element not fill the entire file-tree width (as it's spaced from the left-hand side via margin)
  98. // and, in consequence, the background gets clipped. The ::before pseudo-selector is used to fill
  99. // the empty space.
  100. .fake-full-width-bg(@file-tree-item-hover-bg);
  101. }
  102. input {
  103. line-height: 1.6;
  104. }
  105. }
  106. i.fa {
  107. color: @file-tree-item-icon-color;
  108. font-size: 14px;
  109. &.linked-file-highlight {
  110. & {
  111. color: white;
  112. }
  113. position: relative;
  114. top: 4px;
  115. left: -8px;
  116. font-size: 12px;
  117. }
  118. }
  119. i.fa-folder-open,
  120. i.fa-folder {
  121. color: @file-tree-item-folder-color;
  122. font-size: 14px;
  123. }
  124. i.toggle {
  125. width: 24px;
  126. padding: 6px;
  127. font-size: 16px;
  128. color: @file-tree-item-toggle-color;
  129. }
  130. .file-tree-dropdown-toggle {
  131. display: flex;
  132. align-items: center;
  133. color: #fff;
  134. line-height: 1.6;
  135. font-size: 20px;
  136. padding: 0 4px 0 18px;
  137. &:hover,
  138. &:focus {
  139. text-decoration: none;
  140. }
  141. &::before {
  142. content: '\00B7\00B7\00B7';
  143. transform: rotate(90deg);
  144. letter-spacing: 0.5px;
  145. }
  146. }
  147. &.multi-selected {
  148. > .entity {
  149. > .entity-name {
  150. > div > i.fa,
  151. > i.fa,
  152. .entity-menu-toggle i.fa {
  153. color: #fff;
  154. }
  155. > i.fa i.linked-file-highlight {
  156. color: @blue;
  157. }
  158. color: #fff;
  159. font-weight: bold;
  160. background-color: @file-tree-multiselect-bg;
  161. .fake-full-width-bg(@file-tree-multiselect-bg);
  162. &:hover {
  163. background-color: @file-tree-multiselect-hover-bg;
  164. .fake-full-width-bg(@file-tree-multiselect-hover-bg);
  165. }
  166. }
  167. }
  168. }
  169. .dropdown {
  170. position: absolute;
  171. right: 0;
  172. }
  173. .rename-input {
  174. display: block;
  175. position: absolute;
  176. top: 1px;
  177. left: 44px;
  178. right: 32px;
  179. color: @file-tree-item-input-color;
  180. input {
  181. width: 100%;
  182. }
  183. }
  184. > .entity > .entity-name {
  185. .entity-menu-toggle {
  186. display: none;
  187. }
  188. }
  189. .entity-limit-hit {
  190. color: @file-tree-item-color;
  191. line-height: 2.05;
  192. margin-left: (@line-height-computed / 2);
  193. white-space: nowrap;
  194. overflow: hidden;
  195. text-overflow: ellipsis;
  196. }
  197. .entity-limit-hit-message {
  198. font-style: italic;
  199. }
  200. i.fa.entity-limit-hit-tooltip-trigger {
  201. margin-left: (@line-height-computed / 4);
  202. cursor: pointer;
  203. }
  204. }
  205. }
  206. &:not(.multi-selected) {
  207. ul.file-tree-list li.selected {
  208. > .entity {
  209. > .entity-name {
  210. color: @file-tree-item-selected-color;
  211. > div > i.fa,
  212. > i.fa,
  213. .entity-menu-toggle i.fa {
  214. color: @file-tree-item-selected-color;
  215. }
  216. > i.fa i.linked-file-highlight {
  217. color: @blue;
  218. }
  219. background-color: @file-tree-item-selected-bg;
  220. font-weight: bold;
  221. padding-right: 32px;
  222. .fake-full-width-bg(@file-tree-item-selected-bg);
  223. .entity-menu-toggle {
  224. display: inline-block;
  225. }
  226. }
  227. }
  228. }
  229. }
  230. .ui-draggable-dragging {
  231. background-color: fade(@file-tree-item-selected-bg, 60%);
  232. color: @file-tree-item-selected-color;
  233. width: 75%;
  234. padding-left: @line-height-computed;
  235. }
  236. }
  237. .modal-new-file {
  238. padding: 0;
  239. table {
  240. width: 100%;
  241. td {
  242. vertical-align: top;
  243. }
  244. }
  245. .toggle-output-files-button {
  246. font-size: 80%;
  247. }
  248. }
  249. .modal-new-file--list {
  250. background-color: @modal-footer-background-color;
  251. width: 220px;
  252. ul {
  253. li {
  254. a {
  255. color: @text-color;
  256. padding: (@line-height-computed / 4);
  257. display: block;
  258. text-decoration: none;
  259. }
  260. }
  261. li.active {
  262. background-color: white;
  263. a {
  264. color: @link-color;
  265. }
  266. }
  267. li:hover {
  268. background-color: white;
  269. }
  270. }
  271. }
  272. .modal-new-file--body {
  273. padding: 20px;
  274. padding-top: (@line-height-computed / 4);
  275. }
  276. .modal-new-file--body-upload {
  277. padding-top: 20px;
  278. }
  279. .modal-footer {
  280. .approaching-file-limit {
  281. font-weight: bold;
  282. }
  283. .at-file-limit {
  284. text-align: left;
  285. }
  286. }