editor.less 16 KB

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