file-tree.less 5.7 KB

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