editor.less 13 KB

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