editor.less 14 KB

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