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