editor.less 12 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/enago.less";
  7. @import "./editor/share.less";
  8. @import "./editor/chat.less";
  9. @import "./editor/binary-file.less";
  10. @import "./editor/search.less";
  11. @import "./editor/publish-template.less";
  12. @import "./editor/online-users.less";
  13. @import "./editor/hotkeys.less";
  14. @import "./editor/review-panel.less";
  15. @import "./editor/rich-text.less";
  16. @import "./editor/publish-modal.less";
  17. @ui-layout-toggler-def-height: 50px;
  18. @ui-resizer-size: 7px;
  19. @keyframes blink {
  20. 0% {
  21. opacity: 0.2;
  22. }
  23. 20% {
  24. opacity: 1;
  25. }
  26. 100% {
  27. opacity: 0.2;
  28. }
  29. }
  30. .editor-menu-icon when (@is-overleaf = true) {
  31. &.fa {
  32. width: 1em;
  33. background: @editor-header-logo-background;
  34. &::before {
  35. // Disable the font-awesome icon when in Overleaf by replacing it with a
  36. // non-breakable space instead (otherwise the browser would render a
  37. // zero-width element).
  38. content: "\00a0";
  39. }
  40. }
  41. }
  42. .full-size {
  43. position: absolute;
  44. top: 0;
  45. bottom: 0;
  46. left: 0;
  47. right: 0;
  48. }
  49. .global-alerts {
  50. height: 0;
  51. margin-top: 2px;
  52. text-align: center;
  53. .alert {
  54. display: inline-block;
  55. text-align: left;
  56. min-width: 400px;
  57. padding: @global-alerts-padding;
  58. font-size: 14px;
  59. margin-bottom: (@line-height-computed / 4);
  60. position: relative;
  61. z-index: 20;
  62. }
  63. }
  64. #try-reconnect-now-button {
  65. margin-left: 20px;
  66. }
  67. #synctex-more-info-button {
  68. margin-left: 20px;
  69. }
  70. #ide-body {
  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, #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 .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. max-width: 250px;
  163. overflow: hidden;
  164. text-overflow: ellipsis;
  165. vertical-align: top;
  166. padding: 6px;
  167. color: @project-name-color;
  168. font-weight: 700;
  169. white-space: nowrap;
  170. }
  171. input {
  172. height: 30px;
  173. margin-top: 4px;
  174. text-align: center;
  175. padding: 6px;
  176. font-weight: 700;
  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, .highlights-after-label {
  256. position: absolute;
  257. right: @line-height-computed;
  258. z-index: 1;
  259. }
  260. .highlights-before-label {
  261. top: @line-height-computed / 2;
  262. }
  263. .highlights-after-label {
  264. bottom: @line-height-computed / 2;
  265. }
  266. }
  267. .strike-through-foreground::after {
  268. content: '';
  269. position: absolute;
  270. width: 100%;
  271. top: 50%;
  272. margin-top: -1px;
  273. height: 2px;
  274. background: currentColor;
  275. }
  276. // Hack to solve an issue where scrollbars aren't visible in Safari.
  277. // Safari seems to clip part of the scrollbar element. By giving the
  278. // element a background, we're telling Safari that it *really* needs to
  279. // paint the whole area. See https://github.com/ajaxorg/ace/issues/2872
  280. .ace_scrollbar-inner {
  281. background-color: #FFF;
  282. opacity: 0.01;
  283. .ace_dark & {
  284. background-color: #000;
  285. }
  286. }
  287. /**************************************
  288. CodeMirror
  289. ***************************************/
  290. .cm-editor-wrapper {
  291. position: relative;
  292. height: 100%;
  293. }
  294. .cm-editor-body {
  295. height: 100%;
  296. }
  297. // CM (for some reason) has height set to 300px in it's stylesheet
  298. .CodeMirror {
  299. height: 100%;
  300. }
  301. .ui-layout-resizer when (@is-overleaf = false) {
  302. width: 6px;
  303. background-color: @editor-resizer-bg-color;
  304. border-left: 1px solid @editor-border-color;
  305. border-right: 1px solid @editor-border-color;
  306. .ui-layout-toggler {
  307. color: #999;
  308. font-family: FontAwesome;
  309. font-style: normal;
  310. font-weight: normal;
  311. line-height: 1;
  312. -webkit-font-smoothing: antialiased;
  313. -moz-osx-font-smoothing: grayscale;
  314. font-size: 16px !important;
  315. line-height: 50px;
  316. background-color: @editor-toggler-bg-color;
  317. &:hover {
  318. background-color: @editor-toggler-hover-bg-color;
  319. color: #333;
  320. }
  321. }
  322. }
  323. .ui-layout-resizer when (@is-overleaf = true) {
  324. width: @ui-resizer-size !important;
  325. background-color: @editor-resizer-bg-color;
  326. &.ui-layout-resizer-closed {
  327. &::before,
  328. &::after {
  329. content: none;
  330. }
  331. }
  332. &::before,
  333. &::after {
  334. content: '\2847';
  335. display: block;
  336. position: absolute;
  337. text-align: center;
  338. left: -2px;
  339. -webkit-font-smoothing: antialiased;
  340. width: 100%;
  341. font-size: 24px;
  342. top: 25%;
  343. color: @ol-blue-gray-2;
  344. }
  345. &::after {
  346. top: 75%;
  347. }
  348. }
  349. .ui-layout-resizer-west.ui-layout-resizer-open, .ui-layout-resizer-east.ui-layout-resizer-closed {
  350. .ui-layout-toggler when (@is-overleaf = false) {
  351. &:before {
  352. content: "\f104"
  353. }
  354. }
  355. }
  356. .ui-layout-resizer-east.ui-layout-resizer-open, .ui-layout-resizer-west.ui-layout-resizer-closed {
  357. .ui-layout-toggler when (@is-overleaf = false) {
  358. &:before {
  359. content: "\f105"
  360. }
  361. }
  362. }
  363. .ui-layout-toggler when (@is-overleaf = true) {
  364. display: none !important;
  365. }
  366. .custom-toggler when (@is-overleaf = true) {
  367. position: absolute;
  368. display: flex;
  369. align-items: center;
  370. justify-content: center;
  371. width: @ui-resizer-size !important;
  372. height: 50px;
  373. margin-top: -25px;
  374. top: 50%;
  375. z-index: 3;
  376. background-color: @editor-toggler-bg-color;
  377. &:hover,
  378. &:focus {
  379. outline: none;
  380. text-decoration: none;
  381. }
  382. // Increase hit area
  383. &::before {
  384. content: '';
  385. display: block;
  386. position: absolute;
  387. top: 0;
  388. right: -3px;
  389. bottom: 0;
  390. left: -3px;
  391. }
  392. &::after {
  393. font-family: FontAwesome;
  394. -webkit-font-smoothing: antialiased;
  395. -moz-osx-font-smoothing: grayscale;
  396. font-size: 65%;
  397. font-weight: bold;
  398. color: #FFF;
  399. user-select: none;
  400. pointer-events: none;
  401. }
  402. &:hover {
  403. background-color: @editor-toggler-hover-bg-color;
  404. }
  405. }
  406. .custom-toggler-east::after {
  407. content: '\f105';
  408. }
  409. .custom-toggler-west::after {
  410. content: '\f104';
  411. }
  412. .custom-toggler-closed.custom-toggler-east::after {
  413. content: '\f104';
  414. }
  415. .custom-toggler-closed.custom-toggler-west::after {
  416. content: '\f105';
  417. }
  418. .ui-layout-resizer-dragging {
  419. background-color: @editor-resizer-bg-color-dragging;
  420. }
  421. .context-menu {
  422. position: fixed;
  423. z-index: 100;
  424. }
  425. .editor-dark {
  426. color: @gray-lighter;
  427. background-color: @editor-dark-background-color;
  428. .ui-layout-resizer {
  429. background-color: darken(@editor-dark-background-color, 10%);
  430. border: none;
  431. }
  432. .btn-default {
  433. color: white;
  434. background-color: @gray;
  435. border-color: darken(@gray-dark, 10%);
  436. &:hover {
  437. background-color: darken(@gray, 5%);
  438. border-color: darken(@gray-dark, 20%);
  439. }
  440. }
  441. }
  442. .modal-alert {
  443. margin-top:10px;
  444. margin-bottom:0px;
  445. }
  446. // vertically centre the "connection down" modal so it does not hide
  447. // the reconnecting indicator
  448. .modal.lock-editor-modal {
  449. display: flex !important;
  450. .modal-dialog {
  451. margin: auto;
  452. }
  453. }
  454. .sl_references_search_hint {
  455. position: relative;
  456. top: 100%;
  457. }
  458. .sl_references_search_hint {
  459. position: relative;
  460. left: -1px;
  461. text-align: center;
  462. padding: 2px;
  463. background: rgb(202, 214, 250);
  464. border: 1px solid lightgray;
  465. box-shadow: 3px 3px 5px rgba(0,0,0,.2);
  466. span {
  467. color: black;
  468. }
  469. }
  470. // -- References Search Modal --
  471. .references-search-modal-backdrop {
  472. // don't grey out the editor when the
  473. // modal is active
  474. background-color: transparent;
  475. }
  476. .references-search-modal {
  477. // upgrade prompt
  478. .references-search-upgrade-prompt {
  479. padding: 24px;
  480. padding-bottom: 48px;
  481. .upgrade-prompt {
  482. text-align: center;
  483. width: 400px;
  484. padding-top: 14px;
  485. padding-bottom: 14px;
  486. padding-left: 38px;
  487. padding-right: 38px;
  488. margin: auto;
  489. background: white;
  490. opacity: 0.95;
  491. border-radius: 8px;
  492. .message {
  493. margin-top: 15px;
  494. &.call-to-action {
  495. font-weight: bold;
  496. }
  497. ul.list-unstyled {
  498. text-align: left;
  499. }
  500. }
  501. a.btn {
  502. opacity: 1.0;
  503. }
  504. }
  505. }
  506. .search-form {
  507. // position the spinner inside the input element
  508. i.fa-spinner {
  509. margin-top: -30px;
  510. }
  511. }
  512. .alert-danger {
  513. margin-top: 12px;
  514. margin-bottom: 0px;
  515. }
  516. // search result items list
  517. .search-results {
  518. font-size: 12px;
  519. .no-results-message {
  520. font-size: 16px;
  521. }
  522. .search-result-hit {
  523. &:hover {
  524. cursor: pointer;
  525. }
  526. border-bottom: 1px solid #ddd;
  527. padding: 8px;
  528. &:last-child {
  529. border-bottom: 1px solid transparent;
  530. }
  531. border-left: 4px solid transparent;
  532. &.selected-search-result-hit {
  533. background-color: @red;
  534. color: white;
  535. .hit-year.small {
  536. color: white;
  537. }
  538. .hit-journal.small {
  539. color: white;
  540. }
  541. }
  542. .hit-title {
  543. font-size: 1.3em;
  544. font-style: italic;
  545. }
  546. }
  547. }
  548. }
  549. .referencesImportModal {
  550. .referencesImportPreviewScroller {
  551. font-family: monospace;
  552. font-size: 0.8em;
  553. max-height: 360px;
  554. overflow: scroll;
  555. white-space: pre;
  556. padding: 8px 12px;
  557. margin-bottom: 15px;
  558. border: 1px solid @gray-lighter;
  559. background-color: @gray-lightest;
  560. }
  561. }
  562. .teaser-title,
  563. .dropbox-teaser-title {
  564. margin-top: 0;
  565. text-align: center;
  566. }
  567. .teaser-img,
  568. .dropbox-teaser-img {
  569. .img-responsive;
  570. margin-bottom: 5px;
  571. }
  572. .teaser-video-container,
  573. .dropbox-teaser-video-container {
  574. margin-top: -@modal-inner-padding;
  575. margin-left: -@modal-inner-padding;
  576. margin-right: -@modal-inner-padding;
  577. margin-bottom: 5px;
  578. overflow: hidden;
  579. }
  580. .teaser-video,
  581. .dropbox-teaser-video {
  582. width: 100%;
  583. height: auto;
  584. border-bottom: 1px solid @modal-header-border-color;
  585. }
  586. .spell-check-menu {
  587. > .dropdown-menu > li > a {
  588. padding: 2px 15px;
  589. }
  590. }
  591. .spell-check-menu-from-bottom {
  592. > .dropdown-menu {
  593. top: auto;
  594. bottom: 100%;
  595. }
  596. }