editor.less 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755
  1. @import './editor/file-tree.less';
  2. @import './editor/history.less';
  3. @import './editor/history-react.less';
  4. @import './editor/toolbar.less';
  5. @import './editor/left-menu.less';
  6. @import './editor/pdf.less';
  7. @import './editor/error-boundary.less';
  8. @import './editor/share.less';
  9. @import './editor/chat.less';
  10. @import './editor/toast.less';
  11. @import './editor/file-view.less';
  12. @import './editor/search.less';
  13. @import './editor/publish-template.less';
  14. @import './editor/online-users.less';
  15. @import './editor/math-preview.less';
  16. @import './editor/hotkeys.less';
  17. @import './editor/review-panel.less';
  18. @import './editor/review-panel-new.less';
  19. @import './editor/publish-modal.less';
  20. @import './editor/outline.less';
  21. @import './editor/logs.less';
  22. @import './editor/dictionary.less';
  23. @import './editor/compile-button.less';
  24. @import './editor/figure-modal.less';
  25. @import './editor/table-generator-column-width-modal.less';
  26. @import './editor/ide-react.less';
  27. @ui-layout-toggler-def-height: 50px;
  28. @ui-resizer-size: 7px;
  29. @keyframes blink {
  30. 0% {
  31. opacity: 0.2;
  32. }
  33. 20% {
  34. opacity: 1;
  35. }
  36. 100% {
  37. opacity: 0.2;
  38. }
  39. }
  40. .editor-menu-icon {
  41. &.fa {
  42. width: 1em;
  43. background: @editor-header-logo-background;
  44. &::before {
  45. // Disable the font-awesome icon when in Overleaf by replacing it with a
  46. // non-breakable space instead (otherwise the browser would render a
  47. // zero-width element).
  48. content: '\00a0';
  49. }
  50. }
  51. }
  52. .full-size {
  53. position: absolute;
  54. top: 0;
  55. bottom: 0;
  56. left: 0;
  57. right: 0;
  58. }
  59. .global-alerts {
  60. height: 0;
  61. margin-top: 2px;
  62. text-align: center;
  63. .alert {
  64. display: inline-block;
  65. text-align: left;
  66. min-width: 400px;
  67. padding: @global-alerts-padding;
  68. font-size: 14px;
  69. margin-bottom: (@line-height-computed / 4);
  70. position: relative;
  71. z-index: 20;
  72. }
  73. }
  74. #try-reconnect-now-button {
  75. margin-left: 20px;
  76. }
  77. #synctex-more-info-button {
  78. margin-left: 20px;
  79. }
  80. #ide-body {
  81. background-color: @pdf-bg;
  82. .full-size;
  83. top: @ide-body-top-offset;
  84. }
  85. #editor {
  86. .full-size;
  87. }
  88. .pdf-empty,
  89. .no-history-available,
  90. .no-file-selection,
  91. .multi-selection-ongoing {
  92. &::before {
  93. .full-size;
  94. left: 20px;
  95. content: '';
  96. background: url(../../../public/img/ol-brand/overleaf-o-grey.svg) center /
  97. 200px no-repeat;
  98. opacity: 0.2;
  99. pointer-events: none;
  100. }
  101. }
  102. .no-history-available,
  103. .no-file-selection-message,
  104. .multi-selection-message {
  105. width: 50%;
  106. margin: 0 auto;
  107. text-align: center;
  108. padding: @line-height-computed 0;
  109. }
  110. .faster-compiles-feedback {
  111. position: absolute;
  112. bottom: 0;
  113. right: 0.5rem; // scrollbar
  114. margin: 1rem;
  115. padding: 10px;
  116. .btn {
  117. margin: 0 0 0 10px;
  118. }
  119. .faster-compiles-feedback-options {
  120. display: inline;
  121. white-space: nowrap;
  122. }
  123. .faster-compiles-feedback-option {
  124. background: #1d4c82;
  125. }
  126. .faster-compiles-feedback-dismiss {
  127. border: 0;
  128. margin: 0 0 0 5px;
  129. color: #1d4c82;
  130. right: 0;
  131. top: 0;
  132. float: right;
  133. }
  134. }
  135. .toolbar-editor {
  136. height: @editor-toolbar-height;
  137. background-color: @editor-toolbar-bg;
  138. padding: 0 5px;
  139. overflow: hidden;
  140. position: relative;
  141. z-index: 10; // Prevent track changes showing over toolbar
  142. }
  143. .loading-screen {
  144. display: flex;
  145. flex-direction: column;
  146. justify-content: center;
  147. align-items: center;
  148. width: 100%;
  149. height: 100%;
  150. background-color: #fff;
  151. }
  152. .loading-screen-brand-container {
  153. width: 15%;
  154. min-width: 200px;
  155. text-align: center;
  156. }
  157. .loading-screen-brand {
  158. position: relative;
  159. width: 100%;
  160. padding-top: @editor-loading-logo-padding-top;
  161. height: 0;
  162. background: @editor-loading-logo-background-url no-repeat bottom / 100%;
  163. &::after {
  164. content: '';
  165. position: absolute;
  166. height: inherit;
  167. right: 0;
  168. bottom: 0;
  169. left: 0;
  170. background: @editor-loading-logo-foreground-url no-repeat bottom / 100%;
  171. transition: height 0.5s;
  172. }
  173. }
  174. .loading-screen-label {
  175. margin: 0;
  176. padding-top: 1em;
  177. font-size: 2em;
  178. color: @gray-dark;
  179. }
  180. .loading-screen-ellip {
  181. animation: blink 1.4s both infinite;
  182. &:nth-child(2) {
  183. animation-delay: 0.2s;
  184. }
  185. &:nth-child(3) {
  186. animation-delay: 0.4s;
  187. }
  188. }
  189. .loading-screen-error {
  190. margin: 0;
  191. padding-top: 1em;
  192. color: @state-danger-text;
  193. }
  194. .loading-panel {
  195. .full-size;
  196. padding-top: 10rem;
  197. font-family: @font-family-serif;
  198. text-align: center;
  199. background-color: #fafafa;
  200. }
  201. .loading-panel-file-view {
  202. background-color: @gray-lightest;
  203. }
  204. .error-panel {
  205. .full-size;
  206. padding: @line-height-computed;
  207. background-color: #fafafa;
  208. .alert {
  209. max-width: 400px;
  210. margin: auto;
  211. }
  212. }
  213. .project-name {
  214. .name {
  215. display: inline-block;
  216. overflow: hidden;
  217. text-overflow: ellipsis;
  218. vertical-align: top;
  219. padding: 6px;
  220. color: @project-name-color;
  221. font-weight: 700;
  222. white-space: nowrap;
  223. }
  224. input {
  225. height: 30px;
  226. margin-top: 4px;
  227. text-align: center;
  228. padding: 6px;
  229. font-weight: 700;
  230. max-width: 500px;
  231. }
  232. a.rename {
  233. visibility: hidden;
  234. display: inline-block;
  235. color: @project-rename-link-color;
  236. padding: 5px;
  237. border-radius: @border-radius-small;
  238. cursor: pointer;
  239. &:hover {
  240. text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  241. color: @project-rename-link-color-hover;
  242. text-decoration: none;
  243. }
  244. }
  245. &:hover {
  246. a.rename {
  247. visibility: visible;
  248. }
  249. }
  250. }
  251. /**************************************
  252. CodeMirror
  253. ***************************************/
  254. .cm-editor-wrapper {
  255. position: relative;
  256. height: 100%;
  257. }
  258. .cm-editor-body {
  259. height: 100%;
  260. }
  261. // CM (for some reason) has height set to 300px in it's stylesheet
  262. .CodeMirror {
  263. height: 100%;
  264. }
  265. .ui-layout-resizer {
  266. width: @ui-resizer-size !important;
  267. background-color: @editor-resizer-bg-color;
  268. /* Over-ride z-index set on element by JQuery Layout */
  269. z-index: 0 !important;
  270. &.ui-layout-resizer-closed {
  271. &::before,
  272. &::after {
  273. content: none;
  274. }
  275. }
  276. &::before,
  277. &::after {
  278. content: '\2847';
  279. display: block;
  280. position: absolute;
  281. text-align: center;
  282. left: -2px;
  283. -webkit-font-smoothing: antialiased;
  284. width: 100%;
  285. font-size: 24px;
  286. top: 25%;
  287. color: @ol-blue-gray-2;
  288. }
  289. &::after {
  290. top: 75%;
  291. }
  292. }
  293. .ui-layout-toggler {
  294. display: none !important;
  295. }
  296. .custom-toggler {
  297. position: absolute;
  298. display: flex;
  299. align-items: center;
  300. justify-content: center;
  301. width: @ui-resizer-size !important;
  302. height: 50px;
  303. margin-top: -25px;
  304. top: 50%;
  305. background-color: @editor-toggler-bg-color;
  306. &:hover,
  307. &:focus {
  308. outline: none;
  309. text-decoration: none;
  310. }
  311. // Increase hit area
  312. &::before {
  313. content: '';
  314. display: block;
  315. position: absolute;
  316. top: 0;
  317. right: -3px;
  318. bottom: 0;
  319. left: -3px;
  320. }
  321. &::after {
  322. font-family: FontAwesome;
  323. -webkit-font-smoothing: antialiased;
  324. -moz-osx-font-smoothing: grayscale;
  325. font-size: 65%;
  326. font-weight: bold;
  327. color: #fff;
  328. user-select: none;
  329. pointer-events: none;
  330. }
  331. &:hover {
  332. background-color: @editor-toggler-hover-bg-color;
  333. }
  334. }
  335. .custom-toggler-east::after {
  336. content: '\f105';
  337. }
  338. .custom-toggler-west::after {
  339. content: '\f104';
  340. }
  341. .custom-toggler-closed.custom-toggler-east::after {
  342. content: '\f104';
  343. }
  344. .custom-toggler-closed.custom-toggler-west::after {
  345. content: '\f105';
  346. }
  347. .ui-layout-resizer-dragging {
  348. background-color: @editor-resizer-bg-color-dragging;
  349. z-index: 1000 !important;
  350. }
  351. .context-menu {
  352. position: fixed;
  353. z-index: 100;
  354. }
  355. .editor-dark {
  356. color: @gray-lighter;
  357. background-color: @editor-dark-background-color;
  358. .ui-layout-resizer {
  359. background-color: darken(@editor-dark-background-color, 10%);
  360. border: none;
  361. }
  362. .btn-default {
  363. color: white;
  364. background-color: @gray;
  365. border-color: darken(@gray-dark, 10%);
  366. &:hover {
  367. background-color: darken(@gray, 5%);
  368. border-color: darken(@gray-dark, 20%);
  369. }
  370. }
  371. }
  372. .modal-alert {
  373. margin-top: 10px;
  374. margin-bottom: 0px;
  375. }
  376. // vertically centre the "connection down" modal so it does not hide
  377. // the reconnecting indicator
  378. .modal.lock-editor-modal {
  379. display: flex !important;
  380. background-color: rgba(0, 0, 0, 0.3);
  381. overflow-y: hidden;
  382. pointer-events: none;
  383. .modal-dialog {
  384. top: @line-height-computed;
  385. }
  386. }
  387. .out-of-sync-modal {
  388. .text-preview {
  389. margin-top: @line-height-computed / 2;
  390. .scroll-container {
  391. max-height: 360px;
  392. width: 100%;
  393. background-color: white;
  394. font-size: 0.8em;
  395. line-height: 1.1em;
  396. overflow: auto;
  397. border: 1px solid @gray-lighter;
  398. padding-left: 12px;
  399. padding-right: 12px;
  400. padding-top: 8px;
  401. padding-bottom: 8px;
  402. text-align: left;
  403. white-space: pre;
  404. font-family: monospace;
  405. }
  406. }
  407. }
  408. .sl_references_search_hint {
  409. position: relative;
  410. top: 100%;
  411. }
  412. .sl_references_search_hint {
  413. position: relative;
  414. left: -1px;
  415. text-align: center;
  416. padding: 2px;
  417. background: rgb(202, 214, 250);
  418. border: 1px solid lightgray;
  419. box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.2);
  420. span {
  421. color: black;
  422. }
  423. }
  424. .bibtex-hint-banner {
  425. position: absolute;
  426. top: 8px;
  427. right: 8px;
  428. left: 8px;
  429. z-index: 1000;
  430. display: flex;
  431. justify-content: space-between;
  432. padding: 5px 10px;
  433. }
  434. .bibtex-hint-banner {
  435. align-items: flex-start;
  436. .bibtex-hint-close {
  437. color: inherit;
  438. margin-left: 10px;
  439. font-size: 24px;
  440. padding: 0;
  441. line-height: 1;
  442. border-radius: 0;
  443. &,
  444. &:hover,
  445. &:focus,
  446. &:active {
  447. background-color: transparent;
  448. }
  449. }
  450. }
  451. // -- References Search Modal --
  452. .references-search-modal-backdrop {
  453. // don't grey out the editor when the
  454. // modal is active
  455. background-color: transparent;
  456. }
  457. .references-search-modal {
  458. // upgrade prompt
  459. .references-search-upgrade-prompt {
  460. padding: 24px;
  461. padding-bottom: 48px;
  462. .upgrade-prompt {
  463. text-align: center;
  464. width: 400px;
  465. padding-top: 14px;
  466. padding-bottom: 14px;
  467. padding-left: 38px;
  468. padding-right: 38px;
  469. margin: auto;
  470. background: rgba(255, 255, 255, 0.95);
  471. border-radius: 8px;
  472. .message {
  473. margin-top: 15px;
  474. &.call-to-action {
  475. font-weight: bold;
  476. }
  477. ul.list-unstyled {
  478. text-align: left;
  479. }
  480. }
  481. }
  482. }
  483. .search-form {
  484. // position the spinner inside the input element
  485. i.fa-spinner {
  486. margin-top: -30px;
  487. }
  488. }
  489. .alert-danger {
  490. margin-top: 12px;
  491. margin-bottom: 0px;
  492. }
  493. // search result items list
  494. .search-results {
  495. font-size: 12px;
  496. .no-results-message,
  497. .too-many-results-message {
  498. font-size: 16px;
  499. }
  500. .search-results-scroll-container {
  501. max-height: calc(100vh - 225px);
  502. overflow-y: auto;
  503. }
  504. .search-result-hit {
  505. &:hover {
  506. cursor: pointer;
  507. }
  508. border-bottom: 1px solid #ddd;
  509. padding: 8px;
  510. &:last-child {
  511. border-bottom: 1px solid transparent;
  512. }
  513. border-left: 4px solid transparent;
  514. &.selected-search-result-hit {
  515. color: @brand-success;
  516. }
  517. .hit-title {
  518. font-size: 1.3em;
  519. font-style: italic;
  520. }
  521. }
  522. }
  523. }
  524. .referencesImportModal {
  525. .referencesImportPreviewScroller {
  526. font-family: monospace;
  527. font-size: 0.8em;
  528. max-height: 360px;
  529. overflow: scroll;
  530. white-space: pre;
  531. padding: 8px 12px;
  532. margin-bottom: 15px;
  533. border: 1px solid @gray-lighter;
  534. background-color: @gray-lightest;
  535. }
  536. }
  537. .teaser-feature-icon {
  538. vertical-align: sub;
  539. }
  540. .teaser-title,
  541. .dropbox-teaser-title {
  542. margin-top: 0;
  543. text-align: center;
  544. }
  545. .teaser-refresh-label {
  546. text-align: center;
  547. }
  548. .teaser-img,
  549. .dropbox-teaser-img {
  550. .img-responsive;
  551. margin-bottom: 5px;
  552. }
  553. .teaser-video-container,
  554. .dropbox-teaser-video-container {
  555. margin-top: -@modal-inner-padding;
  556. margin-left: -@modal-inner-padding;
  557. margin-right: -@modal-inner-padding;
  558. margin-bottom: 5px;
  559. overflow: hidden;
  560. }
  561. .teaser-video,
  562. .dropbox-teaser-video {
  563. width: 100%;
  564. height: auto;
  565. border-bottom: 1px solid @modal-header-border-color;
  566. }
  567. .spell-check-menu {
  568. > .dropdown-menu > li > a {
  569. padding: 2px 15px;
  570. }
  571. }
  572. .spell-check-menu-from-bottom {
  573. > .dropdown-menu {
  574. top: auto;
  575. bottom: 100%;
  576. }
  577. }
  578. // The source editor container is managed by jQuery's UI layout library, which adds an `overflow: hidden`
  579. // rule to it. This is problematic because we need overflowing content to be visible (the review panel
  580. // previews are shown on hover, visually outside the source editor container). As the `overflow: hidden`
  581. // rule is added automatically (inline and not configurable), the only workaround is to use `!important`.
  582. .editor-container {
  583. overflow: visible !important;
  584. container-type: inline-size;
  585. }
  586. .pdf-preview-messages {
  587. position: absolute;
  588. right: @margin-sm;
  589. left: @margin-sm;
  590. top: @margin-xl;
  591. z-index: @zindex-popover;
  592. }
  593. .compile-time-warning {
  594. padding: @padding-sm;
  595. background-color: @ol-green;
  596. max-width: 420px;
  597. box-shadow: 5px 5px 6px rgba(0, 0, 0, 0.3);
  598. .warning-content {
  599. display: flex;
  600. align-items: center;
  601. justify-content: space-between;
  602. flex-wrap: wrap;
  603. gap: @alert-padding;
  604. }
  605. .warning-text {
  606. display: inline-block;
  607. font-size: @font-size-small;
  608. }
  609. .upgrade-prompt {
  610. display: inline-flex;
  611. margin-left: auto;
  612. }
  613. button.btn {
  614. background-color: @ol-darker-green;
  615. &.close {
  616. background-color: @ol-green;
  617. }
  618. }
  619. }
  620. .cm6-switch-away-survey {
  621. padding: @padding-sm;
  622. box-shadow: 5px 5px 6px rgba(0, 0, 0, 0.3);
  623. background-color: @ol-blue;
  624. width: 530px;
  625. position: absolute;
  626. right: @margin-sm;
  627. bottom: @margin-xl;
  628. z-index: @zindex-popover;
  629. .btn.close {
  630. background-color: transparent;
  631. color: #fff;
  632. opacity: 1;
  633. }
  634. .warning-content {
  635. display: flex;
  636. align-items: center;
  637. justify-content: space-between;
  638. margin-right: 32px;
  639. }
  640. .warning-text {
  641. padding-right: @alert-padding;
  642. display: inline-block;
  643. font-size: @font-size-small;
  644. }
  645. }
  646. .legacy-editor-warning {
  647. width: 500px;
  648. &.alert.alert-info {
  649. padding: @padding-sm;
  650. }
  651. .btn.close {
  652. background-color: transparent;
  653. color: @white;
  654. opacity: 1;
  655. }
  656. .warning-content {
  657. padding-right: @alert-padding;
  658. font-size: @font-size-small;
  659. margin-right: 32px;
  660. .warning-link {
  661. font-weight: 700;
  662. text-decoration: none;
  663. &:hover {
  664. text-decoration: underline;
  665. }
  666. }
  667. }
  668. }
  669. grammarly-extension[data-grammarly-shadow-root='true'] {
  670. z-index: 1;
  671. }
  672. .editor-notification {
  673. margin: 48px 64px;
  674. width: 80%;
  675. max-width: 560px;
  676. }