editor.less 17 KB

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