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/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/review-panel-new.less';
  18. @import './editor/publish-modal.less';
  19. @import './editor/outline.less';
  20. @import './editor/logs.less';
  21. @import './editor/dictionary.less';
  22. @import './editor/compile-button.less';
  23. @import './editor/figure-modal.less';
  24. @import './editor/table-generator-column-width-modal.less';
  25. @import './editor/ide-react.less';
  26. @ui-layout-toggler-def-height: 50px;
  27. @ui-resizer-size: 7px;
  28. @keyframes blink {
  29. 0% {
  30. opacity: 0.2;
  31. }
  32. 20% {
  33. opacity: 1;
  34. }
  35. 100% {
  36. opacity: 0.2;
  37. }
  38. }
  39. .editor-menu-icon {
  40. &.fa {
  41. width: 1em;
  42. background: @editor-header-logo-background;
  43. &::before {
  44. // Disable the font-awesome icon when in Overleaf by replacing it with a
  45. // non-breakable space instead (otherwise the browser would render a
  46. // zero-width element).
  47. content: '\00a0';
  48. }
  49. }
  50. }
  51. .full-size {
  52. position: absolute;
  53. top: 0;
  54. bottom: 0;
  55. left: 0;
  56. right: 0;
  57. }
  58. .global-alerts {
  59. height: 0;
  60. margin-top: 2px;
  61. text-align: center;
  62. .alert {
  63. display: inline-block;
  64. text-align: left;
  65. min-width: 400px;
  66. padding: @global-alerts-padding;
  67. font-size: 14px;
  68. margin-bottom: (@line-height-computed / 4);
  69. position: relative;
  70. z-index: 20;
  71. }
  72. }
  73. #try-reconnect-now-button {
  74. margin-left: 20px;
  75. }
  76. #synctex-more-info-button {
  77. margin-left: 20px;
  78. }
  79. #ide-body {
  80. background-color: @pdf-bg;
  81. .full-size;
  82. top: @ide-body-top-offset;
  83. }
  84. #editor {
  85. .full-size;
  86. }
  87. .pdf-empty,
  88. .no-history-available,
  89. .no-file-selection,
  90. .multi-selection-ongoing {
  91. &::before {
  92. .full-size;
  93. left: 20px;
  94. content: '';
  95. background: url(../../../public/img/ol-brand/overleaf-o-grey.svg) center /
  96. 200px no-repeat;
  97. opacity: 0.2;
  98. pointer-events: none;
  99. }
  100. }
  101. .no-history-available,
  102. .no-file-selection-message,
  103. .multi-selection-message {
  104. width: 50%;
  105. margin: 0 auto;
  106. text-align: center;
  107. padding: @line-height-computed 0;
  108. }
  109. .faster-compiles-feedback {
  110. position: absolute;
  111. bottom: 0;
  112. right: 0.5rem; // scrollbar
  113. margin: 1rem;
  114. padding: 10px;
  115. .btn {
  116. margin: 0 0 0 10px;
  117. }
  118. .faster-compiles-feedback-options {
  119. display: inline;
  120. white-space: nowrap;
  121. }
  122. .faster-compiles-feedback-option {
  123. background: #1d4c82;
  124. }
  125. .faster-compiles-feedback-dismiss {
  126. border: 0;
  127. margin: 0 0 0 5px;
  128. color: #1d4c82;
  129. right: 0;
  130. top: 0;
  131. float: right;
  132. }
  133. }
  134. .toolbar-editor {
  135. height: @editor-toolbar-height;
  136. background-color: @editor-toolbar-bg;
  137. padding: 0 5px;
  138. overflow: hidden;
  139. position: relative;
  140. z-index: 10; // Prevent track changes showing over toolbar
  141. }
  142. .loading-screen {
  143. display: flex;
  144. flex-direction: column;
  145. justify-content: center;
  146. align-items: center;
  147. width: 100%;
  148. height: 100%;
  149. background-color: #fff;
  150. }
  151. .loading-screen-brand-container {
  152. width: 15%;
  153. min-width: 200px;
  154. text-align: center;
  155. }
  156. .loading-screen-brand {
  157. position: relative;
  158. width: 100%;
  159. padding-top: @editor-loading-logo-padding-top;
  160. height: 0;
  161. background: @editor-loading-logo-background-url no-repeat bottom / 100%;
  162. &::after {
  163. content: '';
  164. position: absolute;
  165. height: inherit;
  166. right: 0;
  167. bottom: 0;
  168. left: 0;
  169. background: @editor-loading-logo-foreground-url no-repeat bottom / 100%;
  170. transition: height 0.5s;
  171. }
  172. }
  173. .loading-screen-label {
  174. margin: 0;
  175. padding-top: 1em;
  176. font-size: 2em;
  177. color: @gray-dark;
  178. }
  179. .loading-screen-ellip {
  180. animation: blink 1.4s both infinite;
  181. &:nth-child(2) {
  182. animation-delay: 0.2s;
  183. }
  184. &:nth-child(3) {
  185. animation-delay: 0.4s;
  186. }
  187. }
  188. .loading-screen-error {
  189. margin: 0;
  190. padding-top: 1em;
  191. color: @state-danger-text;
  192. }
  193. .loading-panel {
  194. .full-size;
  195. padding-top: 10rem;
  196. font-family: @font-family-serif;
  197. text-align: center;
  198. background-color: #fafafa;
  199. }
  200. .loading-panel-file-view {
  201. background-color: @gray-lightest;
  202. }
  203. .error-panel {
  204. .full-size;
  205. padding: @line-height-computed;
  206. background-color: #fafafa;
  207. .alert {
  208. max-width: 400px;
  209. margin: auto;
  210. }
  211. }
  212. .project-name {
  213. .name {
  214. display: inline-block;
  215. overflow: hidden;
  216. text-overflow: ellipsis;
  217. vertical-align: top;
  218. padding: 6px;
  219. color: @project-name-color;
  220. font-weight: 700;
  221. white-space: nowrap;
  222. }
  223. input {
  224. height: 30px;
  225. margin-top: 4px;
  226. text-align: center;
  227. padding: 6px;
  228. font-weight: 700;
  229. max-width: 500px;
  230. }
  231. a.rename {
  232. visibility: hidden;
  233. display: inline-block;
  234. color: @project-rename-link-color;
  235. padding: 5px;
  236. border-radius: @border-radius-small;
  237. cursor: pointer;
  238. &:hover {
  239. text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  240. color: @project-rename-link-color-hover;
  241. text-decoration: none;
  242. }
  243. }
  244. &:hover {
  245. a.rename {
  246. visibility: visible;
  247. }
  248. }
  249. }
  250. /**************************************
  251. CodeMirror
  252. ***************************************/
  253. .cm-editor-wrapper {
  254. position: relative;
  255. height: 100%;
  256. }
  257. .cm-editor-body {
  258. height: 100%;
  259. }
  260. // CM (for some reason) has height set to 300px in it's stylesheet
  261. .CodeMirror {
  262. height: 100%;
  263. }
  264. .ui-layout-resizer {
  265. width: @ui-resizer-size !important;
  266. background-color: @editor-resizer-bg-color;
  267. /* Over-ride z-index set on element by JQuery Layout */
  268. z-index: 0 !important;
  269. &.ui-layout-resizer-closed {
  270. &::before,
  271. &::after {
  272. content: none;
  273. }
  274. }
  275. &::before,
  276. &::after {
  277. content: '\2847';
  278. display: block;
  279. position: absolute;
  280. text-align: center;
  281. left: -2px;
  282. -webkit-font-smoothing: antialiased;
  283. width: 100%;
  284. font-size: 24px;
  285. top: 25%;
  286. color: @ol-blue-gray-2;
  287. }
  288. &::after {
  289. top: 75%;
  290. }
  291. }
  292. .ui-layout-toggler {
  293. display: none !important;
  294. }
  295. .custom-toggler {
  296. position: absolute;
  297. display: flex;
  298. align-items: center;
  299. justify-content: center;
  300. width: @ui-resizer-size !important;
  301. height: 50px;
  302. margin-top: -25px;
  303. top: 50%;
  304. background-color: @editor-toggler-bg-color;
  305. &:hover,
  306. &:focus {
  307. outline: none;
  308. text-decoration: none;
  309. }
  310. // Increase hit area
  311. &::before {
  312. content: '';
  313. display: block;
  314. position: absolute;
  315. top: 0;
  316. right: -3px;
  317. bottom: 0;
  318. left: -3px;
  319. }
  320. &::after {
  321. font-family: FontAwesome;
  322. -webkit-font-smoothing: antialiased;
  323. -moz-osx-font-smoothing: grayscale;
  324. font-size: 65%;
  325. font-weight: bold;
  326. color: #fff;
  327. user-select: none;
  328. pointer-events: none;
  329. }
  330. &:hover {
  331. background-color: @editor-toggler-hover-bg-color;
  332. }
  333. }
  334. .custom-toggler-east::after {
  335. content: '\f105';
  336. }
  337. .custom-toggler-west::after {
  338. content: '\f104';
  339. }
  340. .custom-toggler-closed.custom-toggler-east::after {
  341. content: '\f104';
  342. }
  343. .custom-toggler-closed.custom-toggler-west::after {
  344. content: '\f105';
  345. }
  346. .ui-layout-resizer-dragging {
  347. background-color: @editor-resizer-bg-color-dragging;
  348. z-index: 1000 !important;
  349. }
  350. .context-menu {
  351. position: fixed;
  352. z-index: 100;
  353. }
  354. .editor-dark {
  355. color: @gray-lighter;
  356. background-color: @editor-dark-background-color;
  357. .ui-layout-resizer {
  358. background-color: darken(@editor-dark-background-color, 10%);
  359. border: none;
  360. }
  361. .btn-default {
  362. color: white;
  363. background-color: @gray;
  364. border-color: darken(@gray-dark, 10%);
  365. &:hover {
  366. background-color: darken(@gray, 5%);
  367. border-color: darken(@gray-dark, 20%);
  368. }
  369. }
  370. }
  371. .modal-alert {
  372. margin-top: 10px;
  373. margin-bottom: 0px;
  374. }
  375. // vertically centre the "connection down" modal so it does not hide
  376. // the reconnecting indicator
  377. .modal.lock-editor-modal {
  378. display: flex !important;
  379. background-color: rgba(0, 0, 0, 0.3);
  380. overflow-y: hidden;
  381. pointer-events: none;
  382. .modal-dialog {
  383. top: @line-height-computed;
  384. }
  385. }
  386. .out-of-sync-modal {
  387. .text-preview {
  388. margin-top: @line-height-computed / 2;
  389. .scroll-container {
  390. max-height: 360px;
  391. width: 100%;
  392. background-color: white;
  393. font-size: 0.8em;
  394. line-height: 1.1em;
  395. overflow: auto;
  396. border: 1px solid @gray-lighter;
  397. padding-left: 12px;
  398. padding-right: 12px;
  399. padding-top: 8px;
  400. padding-bottom: 8px;
  401. text-align: left;
  402. white-space: pre;
  403. font-family: monospace;
  404. }
  405. }
  406. }
  407. .sl_references_search_hint {
  408. position: relative;
  409. top: 100%;
  410. }
  411. .sl_references_search_hint {
  412. position: relative;
  413. left: -1px;
  414. text-align: center;
  415. padding: 2px;
  416. background: rgb(202, 214, 250);
  417. border: 1px solid lightgray;
  418. box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.2);
  419. span {
  420. color: black;
  421. }
  422. }
  423. .bibtex-hint-banner {
  424. position: absolute;
  425. top: 8px;
  426. right: 8px;
  427. left: 8px;
  428. z-index: 1000;
  429. display: flex;
  430. justify-content: space-between;
  431. padding: 5px 10px;
  432. }
  433. .bibtex-hint-banner {
  434. align-items: flex-start;
  435. .bibtex-hint-close {
  436. color: inherit;
  437. margin-left: 10px;
  438. font-size: 24px;
  439. padding: 0;
  440. line-height: 1;
  441. border-radius: 0;
  442. &,
  443. &:hover,
  444. &:focus,
  445. &:active {
  446. background-color: transparent;
  447. }
  448. }
  449. }
  450. // -- References Search Modal --
  451. .references-search-modal-backdrop {
  452. // don't grey out the editor when the
  453. // modal is active
  454. background-color: transparent;
  455. }
  456. .references-search-modal {
  457. // upgrade prompt
  458. .references-search-upgrade-prompt {
  459. padding: 24px;
  460. padding-bottom: 48px;
  461. .upgrade-prompt {
  462. text-align: center;
  463. width: 400px;
  464. padding-top: 14px;
  465. padding-bottom: 14px;
  466. padding-left: 38px;
  467. padding-right: 38px;
  468. margin: auto;
  469. background: white;
  470. opacity: 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. a.btn {
  482. opacity: 1;
  483. }
  484. }
  485. }
  486. .search-form {
  487. // position the spinner inside the input element
  488. i.fa-spinner {
  489. margin-top: -30px;
  490. }
  491. }
  492. .alert-danger {
  493. margin-top: 12px;
  494. margin-bottom: 0px;
  495. }
  496. // search result items list
  497. .search-results {
  498. font-size: 12px;
  499. .no-results-message,
  500. .too-many-results-message {
  501. font-size: 16px;
  502. }
  503. .search-results-scroll-container {
  504. max-height: calc(100vh - 225px);
  505. overflow-y: auto;
  506. }
  507. .search-result-hit {
  508. &:hover {
  509. cursor: pointer;
  510. }
  511. border-bottom: 1px solid #ddd;
  512. padding: 8px;
  513. &:last-child {
  514. border-bottom: 1px solid transparent;
  515. }
  516. border-left: 4px solid transparent;
  517. &.selected-search-result-hit {
  518. color: @brand-success;
  519. }
  520. .hit-title {
  521. font-size: 1.3em;
  522. font-style: italic;
  523. }
  524. }
  525. }
  526. }
  527. .referencesImportModal {
  528. .referencesImportPreviewScroller {
  529. font-family: monospace;
  530. font-size: 0.8em;
  531. max-height: 360px;
  532. overflow: scroll;
  533. white-space: pre;
  534. padding: 8px 12px;
  535. margin-bottom: 15px;
  536. border: 1px solid @gray-lighter;
  537. background-color: @gray-lightest;
  538. }
  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. }