editor.less 16 KB

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