editor.less 12 KB

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