editor.less 14 KB

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