editor.less 16 KB

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