editor.less 17 KB

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