editor.less 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  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. position: absolute;
  237. background-image: url(/img/spellcheck-underline.png);
  238. @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  239. background-image: url(/img/spellcheck-underline@2x.png);
  240. background-size: 5px 4px;
  241. }
  242. background-repeat: repeat-x;
  243. background-position: bottom left;
  244. }
  245. .remote-cursor {
  246. position: absolute;
  247. border-left: 2px solid transparent;
  248. // Adds "nubbin" top right of cursor, which inherits the injected color
  249. &::before {
  250. content: '';
  251. position: absolute;
  252. left: -2px;
  253. top: -5px;
  254. height: 5px;
  255. width: 5px;
  256. border-top-width: 3px;
  257. border-right-width: 3px;
  258. border-bottom-width: 2px;
  259. border-left-width: 2px;
  260. border-style: solid;
  261. border-color: inherit;
  262. }
  263. }
  264. .annotation-label {
  265. padding: (@line-height-computed / 4) (@line-height-computed / 2);
  266. font-size: 0.8rem;
  267. z-index: 100;
  268. font-family: @font-family-sans-serif;
  269. color: white;
  270. font-weight: 700;
  271. white-space: nowrap;
  272. }
  273. .annotation {
  274. position: absolute;
  275. z-index: 2;
  276. }
  277. .highlights-before-label,
  278. .highlights-after-label {
  279. position: absolute;
  280. right: @line-height-computed;
  281. z-index: 1;
  282. }
  283. .highlights-before-label {
  284. top: @line-height-computed / 2;
  285. }
  286. .highlights-after-label {
  287. bottom: @line-height-computed / 2;
  288. }
  289. }
  290. .strike-through-foreground::after {
  291. content: '';
  292. position: absolute;
  293. width: 100%;
  294. top: 50%;
  295. margin-top: -1px;
  296. height: 2px;
  297. background: currentColor;
  298. }
  299. // Hack to solve an issue where scrollbars aren't visible in Safari.
  300. // Safari seems to clip part of the scrollbar element. By giving the
  301. // element a background, we're telling Safari that it *really* needs to
  302. // paint the whole area. See https://github.com/ajaxorg/ace/issues/2872
  303. .ace_scrollbar-inner {
  304. background-color: #fff;
  305. opacity: 0.01;
  306. .ace_dark & {
  307. background-color: #000;
  308. }
  309. }
  310. /**************************************
  311. CodeMirror
  312. ***************************************/
  313. .cm-editor-wrapper {
  314. position: relative;
  315. height: 100%;
  316. }
  317. .cm-editor-body {
  318. height: 100%;
  319. }
  320. // CM (for some reason) has height set to 300px in it's stylesheet
  321. .CodeMirror {
  322. height: 100%;
  323. }
  324. .ui-layout-resizer {
  325. width: @ui-resizer-size !important;
  326. background-color: @editor-resizer-bg-color;
  327. &.ui-layout-resizer-closed {
  328. &::before,
  329. &::after {
  330. content: none;
  331. }
  332. }
  333. &::before,
  334. &::after {
  335. content: '\2847';
  336. display: block;
  337. position: absolute;
  338. text-align: center;
  339. left: -2px;
  340. -webkit-font-smoothing: antialiased;
  341. width: 100%;
  342. font-size: 24px;
  343. top: 25%;
  344. color: @ol-blue-gray-2;
  345. }
  346. &::after {
  347. top: 75%;
  348. }
  349. }
  350. .ui-layout-toggler {
  351. display: none !important;
  352. }
  353. .custom-toggler {
  354. position: absolute;
  355. display: flex;
  356. align-items: center;
  357. justify-content: center;
  358. width: @ui-resizer-size !important;
  359. height: 50px;
  360. margin-top: -25px;
  361. top: 50%;
  362. z-index: 3;
  363. background-color: @editor-toggler-bg-color;
  364. &:hover,
  365. &:focus {
  366. outline: none;
  367. text-decoration: none;
  368. }
  369. // Increase hit area
  370. &::before {
  371. content: '';
  372. display: block;
  373. position: absolute;
  374. top: 0;
  375. right: -3px;
  376. bottom: 0;
  377. left: -3px;
  378. }
  379. &::after {
  380. font-family: FontAwesome;
  381. -webkit-font-smoothing: antialiased;
  382. -moz-osx-font-smoothing: grayscale;
  383. font-size: 65%;
  384. font-weight: bold;
  385. color: #fff;
  386. user-select: none;
  387. pointer-events: none;
  388. }
  389. &:hover {
  390. background-color: @editor-toggler-hover-bg-color;
  391. }
  392. }
  393. .custom-toggler-east::after {
  394. content: '\f105';
  395. }
  396. .custom-toggler-west::after {
  397. content: '\f104';
  398. }
  399. .custom-toggler-closed.custom-toggler-east::after {
  400. content: '\f104';
  401. }
  402. .custom-toggler-closed.custom-toggler-west::after {
  403. content: '\f105';
  404. }
  405. .ui-layout-resizer-dragging {
  406. background-color: @editor-resizer-bg-color-dragging;
  407. }
  408. .context-menu {
  409. position: fixed;
  410. z-index: 100;
  411. }
  412. .editor-dark {
  413. color: @gray-lighter;
  414. background-color: @editor-dark-background-color;
  415. .ui-layout-resizer {
  416. background-color: darken(@editor-dark-background-color, 10%);
  417. border: none;
  418. }
  419. .btn-default {
  420. color: white;
  421. background-color: @gray;
  422. border-color: darken(@gray-dark, 10%);
  423. &:hover {
  424. background-color: darken(@gray, 5%);
  425. border-color: darken(@gray-dark, 20%);
  426. }
  427. }
  428. }
  429. .modal-alert {
  430. margin-top: 10px;
  431. margin-bottom: 0px;
  432. }
  433. // vertically centre the "connection down" modal so it does not hide
  434. // the reconnecting indicator
  435. .modal.lock-editor-modal {
  436. display: flex !important;
  437. background-color: rgba(0, 0, 0, 0.3);
  438. overflow-y: hidden;
  439. pointer-events: none;
  440. .modal-dialog {
  441. top: @line-height-computed;
  442. }
  443. }
  444. .out-of-sync-modal {
  445. .text-preview {
  446. margin-top: @line-height-computed / 2;
  447. .scroll-container {
  448. max-height: 360px;
  449. background-color: white;
  450. font-size: 0.8em;
  451. line-height: 1.1em;
  452. overflow: auto;
  453. border: 1px solid @gray-lighter;
  454. padding-left: 12px;
  455. padding-right: 12px;
  456. padding-top: 8px;
  457. padding-bottom: 8px;
  458. text-align: left;
  459. white-space: pre;
  460. font-family: monospace;
  461. }
  462. }
  463. }
  464. .sl_references_search_hint {
  465. position: relative;
  466. top: 100%;
  467. }
  468. .sl_references_search_hint {
  469. position: relative;
  470. left: -1px;
  471. text-align: center;
  472. padding: 2px;
  473. background: rgb(202, 214, 250);
  474. border: 1px solid lightgray;
  475. box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.2);
  476. span {
  477. color: black;
  478. }
  479. }
  480. // -- References Search Modal --
  481. .references-search-modal-backdrop {
  482. // don't grey out the editor when the
  483. // modal is active
  484. background-color: transparent;
  485. }
  486. .references-search-modal {
  487. // upgrade prompt
  488. .references-search-upgrade-prompt {
  489. padding: 24px;
  490. padding-bottom: 48px;
  491. .upgrade-prompt {
  492. text-align: center;
  493. width: 400px;
  494. padding-top: 14px;
  495. padding-bottom: 14px;
  496. padding-left: 38px;
  497. padding-right: 38px;
  498. margin: auto;
  499. background: white;
  500. opacity: 0.95;
  501. border-radius: 8px;
  502. .message {
  503. margin-top: 15px;
  504. &.call-to-action {
  505. font-weight: bold;
  506. }
  507. ul.list-unstyled {
  508. text-align: left;
  509. }
  510. }
  511. a.btn {
  512. opacity: 1;
  513. }
  514. }
  515. }
  516. .search-form {
  517. // position the spinner inside the input element
  518. i.fa-spinner {
  519. margin-top: -30px;
  520. }
  521. }
  522. .alert-danger {
  523. margin-top: 12px;
  524. margin-bottom: 0px;
  525. }
  526. // search result items list
  527. .search-results {
  528. font-size: 12px;
  529. .no-results-message {
  530. font-size: 16px;
  531. }
  532. .search-result-hit {
  533. &:hover {
  534. cursor: pointer;
  535. }
  536. border-bottom: 1px solid #ddd;
  537. padding: 8px;
  538. &:last-child {
  539. border-bottom: 1px solid transparent;
  540. }
  541. border-left: 4px solid transparent;
  542. &.selected-search-result-hit {
  543. color: @brand-success;
  544. }
  545. .hit-title {
  546. font-size: 1.3em;
  547. font-style: italic;
  548. }
  549. }
  550. }
  551. }
  552. .referencesImportModal {
  553. .referencesImportPreviewScroller {
  554. font-family: monospace;
  555. font-size: 0.8em;
  556. max-height: 360px;
  557. overflow: scroll;
  558. white-space: pre;
  559. padding: 8px 12px;
  560. margin-bottom: 15px;
  561. border: 1px solid @gray-lighter;
  562. background-color: @gray-lightest;
  563. }
  564. }
  565. .teaser-title,
  566. .dropbox-teaser-title {
  567. margin-top: 0;
  568. text-align: center;
  569. }
  570. .teaser-img,
  571. .dropbox-teaser-img {
  572. .img-responsive;
  573. margin-bottom: 5px;
  574. }
  575. .teaser-video-container,
  576. .dropbox-teaser-video-container {
  577. margin-top: -@modal-inner-padding;
  578. margin-left: -@modal-inner-padding;
  579. margin-right: -@modal-inner-padding;
  580. margin-bottom: 5px;
  581. overflow: hidden;
  582. }
  583. .teaser-video,
  584. .dropbox-teaser-video {
  585. width: 100%;
  586. height: auto;
  587. border-bottom: 1px solid @modal-header-border-color;
  588. }
  589. .spell-check-menu {
  590. > .dropdown-menu > li > a {
  591. padding: 2px 15px;
  592. }
  593. }
  594. .spell-check-menu-from-bottom {
  595. > .dropdown-menu {
  596. top: auto;
  597. bottom: 100%;
  598. }
  599. }