editor.less 13 KB

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