editor.less 16 KB

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