editor.less 16 KB

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