editor.less 13 KB

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