editor.less 13 KB

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