editor.less 13 KB

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