file-tree.less 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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: 0.7rem;
  128. color: @file-tree-item-toggle-color;
  129. }
  130. &.multi-selected {
  131. > .entity {
  132. > .entity-name {
  133. > div > i.fa,
  134. > i.fa,
  135. .entity-menu-toggle i.fa {
  136. color: #fff;
  137. }
  138. > i.fa i.linked-file-highlight {
  139. color: @blue;
  140. }
  141. color: #fff;
  142. font-weight: bold;
  143. background-color: @file-tree-multiselect-bg;
  144. .fake-full-width-bg(@file-tree-multiselect-bg);
  145. &:hover {
  146. background-color: @file-tree-multiselect-hover-bg;
  147. .fake-full-width-bg(@file-tree-multiselect-hover-bg);
  148. }
  149. }
  150. }
  151. }
  152. .dropdown {
  153. position: absolute;
  154. right: 0;
  155. > a {
  156. padding: 0 12px;
  157. }
  158. }
  159. .rename-input {
  160. display: block;
  161. position: absolute;
  162. top: 1px;
  163. left: 44px;
  164. right: 32px;
  165. color: @file-tree-item-input-color;
  166. input {
  167. width: 100%;
  168. }
  169. }
  170. > .entity > .entity-name {
  171. .entity-menu-toggle {
  172. display: none;
  173. }
  174. }
  175. }
  176. }
  177. &:not(.multi-selected) {
  178. ul.file-tree-list li.selected {
  179. > .entity {
  180. > .entity-name {
  181. color: @file-tree-item-selected-color;
  182. > div > i.fa,
  183. > i.fa,
  184. .entity-menu-toggle i.fa {
  185. color: @file-tree-item-selected-color;
  186. }
  187. > i.fa i.linked-file-highlight {
  188. color: @blue;
  189. }
  190. background-color: @file-tree-item-selected-bg;
  191. font-weight: bold;
  192. padding-right: 32px;
  193. .fake-full-width-bg(@file-tree-item-selected-bg);
  194. .entity-menu-toggle {
  195. display: inline;
  196. }
  197. }
  198. }
  199. }
  200. }
  201. .ui-draggable-dragging {
  202. background-color: fade(@file-tree-item-selected-bg, 60%);
  203. color: @file-tree-item-selected-color;
  204. width: 75%;
  205. padding-left: @line-height-computed;
  206. }
  207. }
  208. .modal-new-file {
  209. padding: 0;
  210. table {
  211. width: 100%;
  212. td {
  213. vertical-align: top;
  214. }
  215. }
  216. .toggle-output-files-button {
  217. font-size: 80%;
  218. }
  219. }
  220. .modal-new-file--list {
  221. background-color: @modal-footer-background-color;
  222. width: 220px;
  223. ul {
  224. li {
  225. a {
  226. color: @text-color;
  227. padding: (@line-height-computed / 4);
  228. display: block;
  229. text-decoration: none;
  230. }
  231. }
  232. li.active {
  233. background-color: white;
  234. a {
  235. color: @link-color;
  236. }
  237. }
  238. li:hover {
  239. background-color: white;
  240. }
  241. }
  242. }
  243. .modal-new-file--body {
  244. padding: 20px;
  245. padding-top: (@line-height-computed / 4);
  246. }
  247. .modal-new-file--body-upload {
  248. padding-top: 20px;
  249. }
  250. .modal-footer {
  251. .approaching-file-limit {
  252. font-weight: bold;
  253. }
  254. .at-file-limit {
  255. text-align: left;
  256. }
  257. }