file-tree.scss 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749
  1. :root {
  2. --file-tree-item-hover-bg: var(--bg-dark-secondary);
  3. --file-tree-item-selected-bg: var(--green-70);
  4. --file-tree-item-color: var(--content-primary-dark);
  5. --file-tree-bg: var(--bg-dark-primary);
  6. --file-tree-item-selected-color: var(--green-10);
  7. --file-tree-item-dragging-bg: var(--green-40);
  8. --file-tree-item-dragging-color: var(--content-primary-dark);
  9. --file-tree-item-icon-dragging-color: var(--file-tree-item-dragging-color);
  10. --file-tree-item-dragging-preview-bg: #{rgb($bg-dark-secondary, 0.6)};
  11. --file-tree-item-dragging-preview-colour: #{rgb($content-primary-dark, 0.6)};
  12. --file-tree-line-height: 2.05;
  13. --file-tree-icon-colour: var(--content-primary-dark);
  14. --file-tree-expand-button-color: var(--content-primary-dark);
  15. }
  16. @include theme('light') {
  17. --file-tree-item-hover-bg: var(--bg-light-secondary);
  18. --file-tree-item-selected-bg: var(--bg-accent-03);
  19. --file-tree-item-color: var(--content-primary);
  20. --file-tree-bg: var(--white);
  21. --file-tree-item-selected-color: var(--green-70);
  22. --file-tree-item-dragging-bg: var(--green-60);
  23. --file-tree-item-dragging-color: var(--white);
  24. --file-tree-item-icon-dragging-color: var(--file-tree-item-dragging-color);
  25. --file-tree-item-dragging-preview-bg: #{rgb($bg-light-secondary, 0.6)};
  26. --file-tree-item-dragging-preview-colour: #{rgb($content-primary, 0.6)};
  27. --file-tree-icon-colour: var(--content-primary);
  28. --file-tree-expand-button-color: var(--content-primary);
  29. }
  30. .file-tree-outline-panel-group {
  31. background-color: var(--file-tree-bg);
  32. }
  33. .file-tree-toolbar {
  34. display: flex;
  35. justify-content: space-between;
  36. height: 28px;
  37. margin: var(--spacing-02);
  38. }
  39. .file-tree-panel {
  40. min-height: 36px;
  41. }
  42. .file-tree-panel-collapsed {
  43. max-height: 36px;
  44. }
  45. .file-tree-expand-collapse-button {
  46. border-radius: var(--border-radius-base);
  47. color: var(--file-tree-expand-button-color);
  48. display: flex;
  49. align-items: center;
  50. background-color: transparent;
  51. border: 0;
  52. padding: 0 var(--spacing-02);
  53. flex-grow: 1;
  54. overflow: hidden;
  55. &:hover {
  56. background-color: var(--file-tree-item-hover-bg);
  57. }
  58. h4 {
  59. color: var(--file-tree-expand-button-color);
  60. font-size: var(--font-size-02);
  61. line-height: var(--line-height-02);
  62. margin: 0;
  63. font-weight: bold;
  64. overflow: hidden;
  65. text-overflow: ellipsis;
  66. white-space: nowrap;
  67. }
  68. }
  69. .file-tree-toolbar-action-buttons {
  70. display: flex;
  71. }
  72. .file-tree-toolbar-action-button {
  73. color: var(--file-tree-expand-button-color);
  74. padding: var(--spacing-02);
  75. border-radius: var(--border-radius-full);
  76. &:hover {
  77. background-color: var(--file-tree-item-hover-bg);
  78. }
  79. &:active {
  80. color: var(--file-tree-expand-button-color);
  81. }
  82. }
  83. .file-tree-folder-list {
  84. border-left: 1px solid
  85. color-mix(in srgb, var(--border-primary) 24%, transparent);
  86. margin-left: 14px !important;
  87. margin-top: 0;
  88. &.file-tree-list {
  89. border-left: none;
  90. margin-left: var(--spacing-02) !important;
  91. > .file-tree-folder-list-inner {
  92. margin-left: 0;
  93. }
  94. }
  95. }
  96. .file-tree-folder-list-inner {
  97. margin-left: 10px;
  98. display: flex;
  99. flex-direction: column;
  100. gap: var(--spacing-02);
  101. }
  102. .item-name,
  103. .folder-expand-collapse-button {
  104. display: flex;
  105. align-items: center;
  106. height: 20px !important;
  107. }
  108. .item-name {
  109. margin-left: var(--spacing-02);
  110. overflow: hidden;
  111. span {
  112. overflow: hidden;
  113. text-overflow: ellipsis;
  114. }
  115. }
  116. .ide-react-file-tree-panel {
  117. display: flex;
  118. flex-direction: column;
  119. // Prevent the file tree expanding beyond the boundary of the panel
  120. .file-tree {
  121. width: 100%;
  122. }
  123. }
  124. .context-menu {
  125. position: fixed;
  126. z-index: 100;
  127. }
  128. .context-menu-upwards {
  129. top: auto;
  130. bottom: 100%;
  131. }
  132. .editor-sidebar {
  133. background-color: var(--file-tree-bg);
  134. display: flex;
  135. flex-direction: column;
  136. }
  137. @include theme('default') {
  138. .file-tree {
  139. .toolbar {
  140. .toolbar-right,
  141. .toolbar-left {
  142. button {
  143. opacity: 0.8;
  144. &:hover,
  145. &:focus,
  146. &:active,
  147. &.active {
  148. background-color: rgba(125 125 125 / 20%);
  149. }
  150. &.active,
  151. &:active {
  152. background-color: rgba(125 125 125 / 40%);
  153. }
  154. }
  155. }
  156. }
  157. }
  158. }
  159. .file-tree {
  160. display: flex !important; // To work around jQuery layout's inline styles
  161. flex-direction: column;
  162. height: 100%;
  163. background-color: var(--file-tree-bg);
  164. .file-tree-inner {
  165. position: relative;
  166. display: flex;
  167. flex-direction: column;
  168. flex-grow: 1;
  169. overflow-y: auto;
  170. width: inherit;
  171. height: inherit;
  172. font-size: var(--font-size-02);
  173. &.no-toolbar {
  174. top: 0;
  175. }
  176. }
  177. // TODO; Consolidate with "Project files" in Overleaf
  178. h3 {
  179. font-size: var(--font-size-03);
  180. border-bottom: 1px solid var(--border-primary);
  181. padding-bottom: var(--spacing-02);
  182. margin: var(--spacing-05);
  183. }
  184. .toolbar {
  185. .toolbar-right,
  186. .toolbar-left {
  187. button {
  188. display: inline-flex;
  189. align-items: center;
  190. justify-content: center;
  191. width: 24px;
  192. height: 24px;
  193. padding: 0;
  194. box-shadow: none;
  195. border-radius: var(--border-radius-base);
  196. border: none;
  197. &:hover,
  198. &:focus,
  199. &:active,
  200. &.active {
  201. background-color: rgb(125 125 125 / 10%);
  202. color: var(--toolbar-btn-color) !important;
  203. }
  204. &.active,
  205. &:active {
  206. background-color: rgb(125 125 125 / 20%);
  207. }
  208. }
  209. }
  210. }
  211. ul.file-tree-list {
  212. margin: var(--spacing-02);
  213. overflow: hidden auto;
  214. height: 100%;
  215. flex-grow: 1;
  216. position: relative;
  217. .entity > ul,
  218. ul[role='tree'] {
  219. margin-left: var(--spacing-08);
  220. }
  221. &::after {
  222. content: '';
  223. display: block;
  224. min-height: var(--spacing-08);
  225. }
  226. li {
  227. line-height: var(--file-tree-line-height);
  228. position: relative;
  229. .entity {
  230. user-select: none;
  231. }
  232. .entity > .entity-name {
  233. display: flex;
  234. align-items: center;
  235. & > button {
  236. background-color: transparent;
  237. border: 0;
  238. &.item-name {
  239. color: inherit;
  240. width: 100%;
  241. overflow: hidden;
  242. text-overflow: ellipsis;
  243. text-align: left;
  244. padding-right: var(--spacing-09);
  245. white-space: pre;
  246. }
  247. }
  248. }
  249. .entity-name {
  250. color: var(--file-tree-item-color);
  251. border-radius: var(--border-radius-base);
  252. cursor: pointer;
  253. white-space: nowrap;
  254. overflow: hidden;
  255. text-overflow: ellipsis;
  256. &.entity-name-react {
  257. text-overflow: clip;
  258. }
  259. background-color: transparent;
  260. &:hover {
  261. background-color: var(--file-tree-item-hover-bg);
  262. }
  263. input {
  264. line-height: 1.6;
  265. }
  266. .entity-menu-toggle > .material-symbols {
  267. color: var(--content-primary-dark);
  268. vertical-align: middle;
  269. }
  270. }
  271. .material-symbols {
  272. color: var(--file-tree-icon-colour);
  273. &.file-tree-icon {
  274. margin-right: 0;
  275. margin-left: 0;
  276. vertical-align: sub;
  277. &.linked-file-icon {
  278. position: relative;
  279. left: -2px;
  280. + .linked-file-highlight {
  281. color: var(--file-tree-icon-colour);
  282. background-color: var(--file-tree-bg);
  283. position: absolute;
  284. top: 14px;
  285. left: 14px;
  286. font-size: var(--font-size-01);
  287. border-radius: var(--spacing-01);
  288. }
  289. }
  290. }
  291. &.file-tree-expand-icon {
  292. margin-left: 0;
  293. vertical-align: sub;
  294. }
  295. }
  296. .material-symbols.toggle {
  297. width: 24px;
  298. padding: var(--spacing-03);
  299. font-size: var(--font-size-03);
  300. color: var(--file-tree-icon-colour);
  301. }
  302. .file-tree-dropdown-toggle {
  303. display: flex;
  304. align-items: center;
  305. color: var(--content-primary-dark);
  306. line-height: 1.6;
  307. font-size: var(--font-size-05);
  308. padding: 0 var(--font-size-02) 0 var(--font-size-04);
  309. &:hover,
  310. &:focus {
  311. text-decoration: none;
  312. }
  313. &::before {
  314. content: '\00B7\00B7\00B7';
  315. transform: rotate(90deg);
  316. letter-spacing: 0.5px;
  317. }
  318. }
  319. &.multi-selected {
  320. > .entity {
  321. > .entity-name {
  322. > div > .material-symbols,
  323. > button > .material-symbols,
  324. > .material-symbols,
  325. .entity-menu-toggle .material-symbols {
  326. color: var(--content-primary-dark);
  327. }
  328. > .material-symbols.linked-file-highlight {
  329. background-color: var(--bg-info-01);
  330. }
  331. color: var(--content-primary-dark);
  332. font-weight: bold;
  333. background-color: var(--bg-info-01);
  334. &:hover {
  335. background-color: var(--bg-info-02);
  336. }
  337. }
  338. }
  339. }
  340. .file-tree-bib-badge {
  341. position: absolute;
  342. right: var(--spacing-09);
  343. top: 0;
  344. bottom: 0;
  345. display: flex;
  346. align-items: center;
  347. .material-symbols {
  348. font-size: var(--font-size-03);
  349. &.labs-badge {
  350. color: var(--white);
  351. }
  352. &.info-badge {
  353. color: var(--blue-50);
  354. }
  355. }
  356. }
  357. .file-tree-has-bib-badge .item-name {
  358. padding-right: var(--spacing-09);
  359. }
  360. .menu-button {
  361. position: absolute;
  362. right: 0;
  363. }
  364. .rename-input {
  365. display: block;
  366. position: absolute;
  367. top: 1px;
  368. left: 32px;
  369. right: 32px;
  370. color: var(--content-primary);
  371. input {
  372. width: 100%;
  373. }
  374. }
  375. > .entity > .entity-name {
  376. .entity-menu-toggle {
  377. display: none;
  378. }
  379. }
  380. .entity-limit-hit {
  381. line-height: var(--file-tree-line-height);
  382. color: var(--file-tree-item-color);
  383. margin-left: var(--spacing-05);
  384. white-space: nowrap;
  385. overflow: hidden;
  386. text-overflow: ellipsis;
  387. }
  388. .entity-limit-hit-message {
  389. font-style: italic;
  390. }
  391. .material-symbols .entity-limit-hit-tooltip-trigger {
  392. margin-left: var(spacing-03);
  393. cursor: pointer;
  394. }
  395. }
  396. }
  397. &:not(.multi-selected) {
  398. ul.file-tree-list li.selected {
  399. > .entity {
  400. > .entity-name {
  401. background-color: var(--file-tree-item-selected-bg);
  402. color: var(--file-tree-item-selected-color);
  403. > div > .material-symbols,
  404. > button > .material-symbols,
  405. > .material-symbols,
  406. .entity-menu-toggle .material-symbols {
  407. color: var(--file-tree-item-selected-color);
  408. }
  409. > .material-symbols.linked-file-highlight {
  410. background-color: var(--bg-info-01);
  411. }
  412. font-weight: bold;
  413. padding-right: var(--spacing-09);
  414. button {
  415. font-weight: inherit;
  416. }
  417. .entity-menu-toggle {
  418. display: inline-block;
  419. background-color: transparent;
  420. border: 0;
  421. padding-right: var(--spacing-02);
  422. padding-left: var(--spacing-02);
  423. }
  424. }
  425. }
  426. }
  427. }
  428. // while dragging, the previously selected item gets no highlight
  429. ul.file-tree-list.file-tree-dragging li.selected .entity .entity-name {
  430. font-weight: normal;
  431. background-color: transparent;
  432. color: var(--file-tree-item-color);
  433. .material-symbols {
  434. color: var(--content-disabled) !important;
  435. }
  436. }
  437. // the items being dragged get the full "hover" colour
  438. ul.file-tree-list.file-tree-dragging
  439. li
  440. .entity.file-tree-entity-dragging
  441. .entity-name {
  442. background-color: var(--file-tree-item-dragging-bg);
  443. color: var(--file-tree-item-dragging-color);
  444. .material-symbols {
  445. color: var(--file-tree-item-icon-dragging-color) !important;
  446. }
  447. }
  448. // the drop target gets the "selected" colour
  449. ul.file-tree-list.file-tree-dragging
  450. li.dnd-droppable-hover
  451. .entity
  452. .entity-name {
  453. background-color: var(--file-tree-item-selected-bg);
  454. color: var(--file-tree-item-selected-color);
  455. .material-symbols {
  456. color: var(--file-tree-item-selected-color) !important;
  457. }
  458. }
  459. .dnd-draggable-preview-layer {
  460. position: absolute;
  461. pointer-events: none;
  462. z-index: 100;
  463. width: 100%;
  464. height: 100%;
  465. overflow: hidden;
  466. &.dnd-droppable-hover {
  467. border: 3px solid var(--file-tree-item-selected-bg);
  468. }
  469. }
  470. .dnd-draggable-preview-item {
  471. color: var(--file-tree-item-dragging-preview-colour);
  472. background-color: var(--file-tree-item-dragging-preview-bg);
  473. border-radius: var(--border-radius-base);
  474. width: 75%;
  475. padding-left: var(--spacing-08);
  476. line-height: 2.05;
  477. overflow: hidden;
  478. text-overflow: ellipsis;
  479. white-space: nowrap;
  480. }
  481. .disconnected-overlay {
  482. background-color: var(--file-tree-bg);
  483. position: absolute;
  484. top: 0;
  485. left: 0;
  486. width: 100%;
  487. height: 100%;
  488. z-index: 10;
  489. opacity: 0.5;
  490. cursor: wait;
  491. }
  492. }
  493. .modal-new-file {
  494. padding: 0;
  495. table {
  496. width: 100%;
  497. table-layout: fixed;
  498. td {
  499. vertical-align: top;
  500. }
  501. }
  502. .toggle-file-type-button {
  503. font-size: var(--font-size-02);
  504. margin-top: calc(var(--spacing-05) * -1);
  505. .btn {
  506. display: inline-block;
  507. padding: 0;
  508. vertical-align: baseline;
  509. font-size: inherit;
  510. }
  511. .btn:focus-within {
  512. outline: none;
  513. text-decoration: none;
  514. }
  515. }
  516. }
  517. .modal-new-file-list {
  518. background-color: var(--bg-light-secondary);
  519. width: 220px;
  520. ul {
  521. li {
  522. /* old modal (a) */
  523. a {
  524. color: var(--content-secondary);
  525. padding: var(--spacing-03);
  526. display: block;
  527. text-decoration: none;
  528. }
  529. /* new modal (button) */
  530. .btn {
  531. color: var(--content-secondary);
  532. padding: var(--spacing-03);
  533. }
  534. .btn:hover {
  535. text-decoration: none;
  536. }
  537. .btn:focus {
  538. outline: none;
  539. text-decoration: none;
  540. background-color: white;
  541. }
  542. }
  543. li.active {
  544. background-color: white;
  545. /* old modal (a) */
  546. a {
  547. color: var(--link-ui);
  548. }
  549. /* new modal (button) */
  550. .btn {
  551. color: var(--link-ui);
  552. text-decoration: none;
  553. }
  554. }
  555. li:hover {
  556. background-color: white;
  557. }
  558. }
  559. }
  560. .file-tree-error {
  561. text-align: center;
  562. color: var(--content-secondary-dark);
  563. padding: 20px;
  564. }
  565. .file-tree-modal-alert {
  566. margin-top: var(--spacing-06);
  567. }
  568. .file-tree-entity-button,
  569. .file-tree-entity-details {
  570. display: flex;
  571. width: 100%;
  572. color: inherit;
  573. padding: var(--spacing-02);
  574. text-overflow: ellipsis;
  575. overflow: hidden;
  576. }
  577. .btn.modal-new-file-mode {
  578. justify-content: left;
  579. text-align: left;
  580. text-decoration: none;
  581. width: 100%;
  582. }
  583. .modal-new-file-body {
  584. padding: 20px;
  585. padding-top: var(--spacing-03);
  586. }
  587. .modal-new-file-body-upload {
  588. padding-top: 20px;
  589. }
  590. .modal-new-file-body-conflict {
  591. background-color: var(--bg-danger-03);
  592. border: 1px dashed var(--border-danger);
  593. min-height: 400px;
  594. border-radius: 3px;
  595. color: var(--content-primary);
  596. display: flex;
  597. flex-direction: column;
  598. justify-content: center;
  599. padding: var(--spacing-05);
  600. }
  601. /* stylelint-disable selector-class-pattern */
  602. .modal-new-file-body-upload .uppy-Root {
  603. font-family: inherit;
  604. }
  605. .modal-new-file-body-upload .uppy-Dashboard {
  606. .uppy-Dashboard-inner {
  607. border: none;
  608. }
  609. .uppy-Dashboard-dropFilesHereHint {
  610. inset: 0;
  611. }
  612. .uppy-Dashboard-AddFiles {
  613. margin: 0;
  614. border: 1px dashed var(--border-primary);
  615. height: 100%;
  616. .uppy-Dashboard-AddFiles-title {
  617. font-size: inherit;
  618. }
  619. }
  620. .uppy-Dashboard-AddFiles-title {
  621. width: 26em; // sized to create a wrap between the sentences
  622. max-width: 100%;
  623. }
  624. .uppy-Informer p {
  625. background-color: var(--bg-info-03);
  626. border: 1px solid var(--blue-20);
  627. border-radius: var(--border-radius-base);
  628. color: var(--content-primary);
  629. font-size: var(--font-size-03);
  630. }
  631. }