file-tree.less 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  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. ul.file-tree-list when (@is-overleaf = false) {
  36. font-size: 0.8rem;
  37. padding: (@line-height-computed / 4) 0;
  38. }
  39. &-history {
  40. .entity-name {
  41. padding-left: 6px;
  42. &.deleted {
  43. text-decoration: line-through;
  44. }
  45. }
  46. .loading {
  47. padding-left: 6px;
  48. color: #fff;
  49. i.fa {
  50. color: #fff;
  51. }
  52. }
  53. }
  54. li .entity-name.droppable-hover when (@is-overleaf = true) {
  55. font-weight: bold;
  56. background-color: @file-tree-item-hover-bg;
  57. .fake-full-width-bg(@file-tree-item-hover-bg);
  58. }
  59. li .entity-name.droppable-hover when (@is-overleaf-light = true) {
  60. // color: @file-tree-item-selected-color;
  61. }
  62. ul.droppable-hover li div.entity-name:hover when (@is-overleaf = true) {
  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. ul {
  75. margin-left: (@line-height-computed / 2);
  76. }
  77. li {
  78. line-height: @file-tree-line-height;
  79. position: relative;
  80. .entity {
  81. user-select: none;
  82. }
  83. .entity-name {
  84. color: @file-tree-item-color;
  85. cursor: pointer;
  86. white-space: nowrap;
  87. overflow: hidden;
  88. text-overflow: ellipsis;
  89. &:hover {
  90. background-color: @file-tree-item-hover-bg;
  91. }
  92. &:hover when (@is-overleaf = true) {
  93. // When the entity is a subfolder, the DOM element is "indented" via margin-left. This makes the
  94. // element not fill the entire file-tree width (as it's spaced from the left-hand side via margin)
  95. // and, in consequence, the background gets clipped. The ::before pseudo-selector is used to fill
  96. // the empty space.
  97. .fake-full-width-bg(@file-tree-item-hover-bg);
  98. }
  99. input {
  100. line-height: 1.6;
  101. }
  102. &.droppable-hover when (@is-overleaf = false) {
  103. background-color: fade(@file-tree-droppable-bg-color, 60%);
  104. }
  105. }
  106. i.fa {
  107. color: @file-tree-item-icon-color;
  108. font-size: 14px;
  109. &.linked-file-highlight {
  110. &when (@is-overleaf = true) {
  111. color: white;
  112. }
  113. &when (@is-overleaf = false) {
  114. color: @blue;
  115. }
  116. position: relative;
  117. top: 4px;
  118. left: -8px;
  119. font-size: 12px;
  120. }
  121. }
  122. i.fa-folder-open,
  123. i.fa-folder {
  124. color: @file-tree-item-folder-color;
  125. font-size: 14px;
  126. }
  127. i.toggle {
  128. width: 24px;
  129. padding: 6px;
  130. font-size: 0.7rem;
  131. color: @file-tree-item-toggle-color;
  132. }
  133. &.multi-selected {
  134. > .entity > .entity-name when (@is-overleaf = false) {
  135. background-color: @file-tree-multiselect-bg;
  136. &:hover {
  137. background-color: @file-tree-multiselect-hover-bg;
  138. }
  139. }
  140. > .entity when (@is-overleaf = true) {
  141. > .entity-name {
  142. > div > i.fa,
  143. > i.fa,
  144. .entity-menu-toggle i.fa {
  145. color: #fff;
  146. }
  147. > i.fa i.linked-file-highlight {
  148. color: @blue;
  149. }
  150. color: #fff;
  151. font-weight: bold;
  152. background-color: @file-tree-multiselect-bg;
  153. .fake-full-width-bg(@file-tree-multiselect-bg);
  154. &:hover {
  155. background-color: @file-tree-multiselect-hover-bg;
  156. .fake-full-width-bg(@file-tree-multiselect-hover-bg);
  157. }
  158. }
  159. }
  160. }
  161. .dropdown {
  162. position: absolute;
  163. right: 0;
  164. > a {
  165. padding: 0 12px;
  166. }
  167. }
  168. .rename-input {
  169. display: block;
  170. position: absolute;
  171. top: 1px;
  172. left: 44px;
  173. right: 32px;
  174. color: @file-tree-item-input-color;
  175. input {
  176. width: 100%;
  177. }
  178. }
  179. > .entity > .entity-name {
  180. .entity-menu-toggle {
  181. display: none;
  182. }
  183. }
  184. }
  185. }
  186. &:not(.multi-selected) {
  187. ul.file-tree-list li.selected {
  188. > .entity > .entity-name when (@is-overleaf = false) {
  189. color: @link-color;
  190. border-right: 4px solid @link-color;
  191. font-weight: bold;
  192. padding-right: 32px;
  193. i.fa-folder-open,
  194. i.fa {
  195. color: @link-color;
  196. }
  197. .entity-menu-toggle {
  198. display: inline;
  199. }
  200. }
  201. > .entity when (@is-overleaf = true) {
  202. > .entity-name {
  203. color: @file-tree-item-selected-color;
  204. > div > i.fa,
  205. > i.fa,
  206. .entity-menu-toggle i.fa {
  207. color: @file-tree-item-selected-color;
  208. }
  209. > i.fa i.linked-file-highlight {
  210. color: @blue;
  211. }
  212. background-color: @file-tree-item-selected-bg;
  213. font-weight: bold;
  214. padding-right: 32px;
  215. .fake-full-width-bg(@file-tree-item-selected-bg);
  216. .entity-menu-toggle {
  217. display: inline;
  218. }
  219. }
  220. }
  221. }
  222. }
  223. ul.droppable-hover.file-tree-list when (@is-overleaf = false) {
  224. background-color: fade(@file-tree-droppable-bg-color, 60%);
  225. }
  226. .ui-draggable-dragging when (@is-overleaf = true) {
  227. background-color: fade(@file-tree-item-selected-bg, 60%);
  228. color: @file-tree-item-selected-color;
  229. width: 75%;
  230. padding-left: @line-height-computed;
  231. }
  232. }
  233. // TODO check if the OL Beta theme is OK with darker themes.
  234. .editor-dark when (@is-overleaf = false) {
  235. aside#file-tree {
  236. // background-color: lighten(@editor-dark-background-color, 10%);
  237. ul.file-tree-list {
  238. .dropdown-toggle {
  239. color: @editor-dark-highlight-color;
  240. }
  241. li {
  242. .entity-name {
  243. color: #aaaaaa;
  244. &:hover {
  245. background-color: black;
  246. }
  247. }
  248. &.selected {
  249. > .entity > .entity-name {
  250. color: @editor-dark-highlight-color;
  251. border-color: @editor-dark-highlight-color;
  252. i.fa-folder-open,
  253. i.fa-folder,
  254. i.fa-file,
  255. i.fa-image,
  256. i.fa-file-pdf-o {
  257. color: @editor-dark-highlight-color;
  258. }
  259. }
  260. }
  261. }
  262. }
  263. }
  264. }
  265. .modal-new-file {
  266. padding: 0;
  267. table {
  268. width: 100%;
  269. td {
  270. vertical-align: top;
  271. }
  272. }
  273. .toggle-output-files-button {
  274. font-size: 80%;
  275. }
  276. }
  277. .modal-new-file--list {
  278. background-color: @modal-footer-background-color;
  279. width: 220px;
  280. ul {
  281. li {
  282. a {
  283. color: @text-color;
  284. padding: (@line-height-computed / 4);
  285. display: block;
  286. text-decoration: none;
  287. }
  288. }
  289. li.active {
  290. background-color: white;
  291. a {
  292. color: @link-color;
  293. }
  294. }
  295. li:hover {
  296. background-color: white;
  297. }
  298. }
  299. }
  300. .modal-new-file--body {
  301. padding: 20px;
  302. padding-top: (@line-height-computed / 4);
  303. }
  304. .modal-new-file--body-upload {
  305. padding-top: 20px;
  306. }