editor.less 14 KB

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