editor.less 13 KB

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