editor.less 13 KB

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