editor.less 14 KB

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