editor.less 14 KB

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