editor.less 14 KB

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