editor.less 13 KB

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