editor.less 17 KB

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