editor.less 14 KB

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