editor.less 13 KB

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