editor.less 13 KB

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