editor.less 14 KB

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