editor.less 17 KB

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