file-tree.less 6.1 KB

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