editor.less 17 KB

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