editor.less 17 KB

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