editor.less 14 KB

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