editor.less 17 KB

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