editor.less 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665
  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. .nubbin {
  224. height: 5px;
  225. width: 5px;
  226. position: absolute;
  227. left: -2px;
  228. }
  229. }
  230. .annotation-label {
  231. padding: (@line-height-computed / 4) (@line-height-computed / 2);
  232. font-size: 0.8rem;
  233. z-index: 100;
  234. font-family: @font-family-sans-serif;
  235. color: white;
  236. font-weight: 700;
  237. white-space: nowrap;
  238. }
  239. .annotation {
  240. position: absolute;
  241. z-index: 2;
  242. }
  243. .highlights-before-label, .highlights-after-label {
  244. position: absolute;
  245. right: @line-height-computed;
  246. z-index: 1;
  247. }
  248. .highlights-before-label {
  249. top: @line-height-computed / 2;
  250. }
  251. .highlights-after-label {
  252. bottom: @line-height-computed / 2;
  253. }
  254. }
  255. // Hack to solve an issue where scrollbars aren't visible in Safari.
  256. // Safari seems to clip part of the scrollbar element. By giving the
  257. // element a background, we're telling Safari that it *really* needs to
  258. // paint the whole area. See https://github.com/ajaxorg/ace/issues/2872
  259. .ace_scrollbar-inner {
  260. background-color: #FFF;
  261. opacity: 0.01;
  262. .ace_dark & {
  263. background-color: #000;
  264. }
  265. }
  266. /**************************************
  267. CodeMirror
  268. ***************************************/
  269. .cm-editor-wrapper {
  270. position: relative;
  271. height: 100%;
  272. }
  273. .cm-editor-body {
  274. height: 100%;
  275. }
  276. // CM (for some reason) has height set to 300px in it's stylesheet
  277. .CodeMirror {
  278. height: 100%;
  279. }
  280. .ui-layout-resizer when (@is-overleaf = false) {
  281. width: 6px;
  282. background-color: @editor-resizer-bg-color;
  283. border-left: 1px solid @editor-border-color;
  284. border-right: 1px solid @editor-border-color;
  285. .ui-layout-toggler {
  286. color: #999;
  287. font-family: FontAwesome;
  288. font-style: normal;
  289. font-weight: normal;
  290. line-height: 1;
  291. -webkit-font-smoothing: antialiased;
  292. -moz-osx-font-smoothing: grayscale;
  293. font-size: 16px !important;
  294. line-height: 50px;
  295. background-color: @editor-toggler-bg-color;
  296. &:hover {
  297. background-color: @editor-toggler-hover-bg-color;
  298. color: #333;
  299. }
  300. }
  301. }
  302. .ui-layout-resizer when (@is-overleaf = true) {
  303. width: @ui-resizer-size !important;
  304. background-color: @editor-resizer-bg-color;
  305. &.ui-layout-resizer-closed {
  306. &::before,
  307. &::after {
  308. content: none;
  309. }
  310. }
  311. &::before,
  312. &::after {
  313. content: '\2847';
  314. display: block;
  315. position: absolute;
  316. text-align: center;
  317. left: -2px;
  318. -webkit-font-smoothing: antialiased;
  319. width: 100%;
  320. font-size: 24px;
  321. top: 25%;
  322. color: @ol-blue-gray-2;
  323. }
  324. &::after {
  325. top: 75%;
  326. }
  327. }
  328. .ui-layout-resizer-west.ui-layout-resizer-open, .ui-layout-resizer-east.ui-layout-resizer-closed {
  329. .ui-layout-toggler when (@is-overleaf = false) {
  330. &:before {
  331. content: "\f104"
  332. }
  333. }
  334. }
  335. .ui-layout-resizer-east.ui-layout-resizer-open, .ui-layout-resizer-west.ui-layout-resizer-closed {
  336. .ui-layout-toggler when (@is-overleaf = false) {
  337. &:before {
  338. content: "\f105"
  339. }
  340. }
  341. }
  342. .ui-layout-toggler when (@is-overleaf = true) {
  343. display: none !important;
  344. }
  345. .custom-toggler when (@is-overleaf = true) {
  346. position: absolute;
  347. display: flex;
  348. align-items: center;
  349. justify-content: center;
  350. width: @ui-resizer-size !important;
  351. height: 50px;
  352. margin-top: -25px;
  353. top: 50%;
  354. z-index: 3;
  355. background-color: @editor-toggler-bg-color;
  356. &:hover,
  357. &:focus {
  358. outline: none;
  359. text-decoration: none;
  360. }
  361. // Increase hit area
  362. &::before {
  363. content: '';
  364. display: block;
  365. position: absolute;
  366. top: 0;
  367. right: -3px;
  368. bottom: 0;
  369. left: -3px;
  370. }
  371. &::after {
  372. font-family: FontAwesome;
  373. -webkit-font-smoothing: antialiased;
  374. -moz-osx-font-smoothing: grayscale;
  375. font-size: 65%;
  376. font-weight: bold;
  377. color: #FFF;
  378. user-select: none;
  379. pointer-events: none;
  380. }
  381. &:hover {
  382. background-color: @editor-toggler-hover-bg-color;
  383. }
  384. }
  385. .custom-toggler-east::after {
  386. content: '\f105';
  387. }
  388. .custom-toggler-west::after {
  389. content: '\f104';
  390. }
  391. .custom-toggler-closed.custom-toggler-east::after {
  392. content: '\f104';
  393. }
  394. .custom-toggler-closed.custom-toggler-west::after {
  395. content: '\f105';
  396. }
  397. .ui-layout-resizer-dragging {
  398. background-color: @editor-resizer-bg-color-dragging;
  399. }
  400. .context-menu {
  401. position: fixed;
  402. z-index: 100;
  403. }
  404. .editor-dark {
  405. color: @gray-lighter;
  406. background-color: @editor-dark-background-color;
  407. .ui-layout-resizer {
  408. background-color: darken(@editor-dark-background-color, 10%);
  409. border: none;
  410. }
  411. .btn-default {
  412. color: white;
  413. background-color: @gray;
  414. border-color: darken(@gray-dark, 10%);
  415. &:hover {
  416. background-color: darken(@gray, 5%);
  417. border-color: darken(@gray-dark, 20%);
  418. }
  419. }
  420. }
  421. .modal-alert {
  422. margin-top:10px;
  423. margin-bottom:0px;
  424. }
  425. // vertically centre the "connection down" modal so it does not hide
  426. // the reconnecting indicator
  427. .modal.lock-editor-modal {
  428. display: flex !important;
  429. .modal-dialog {
  430. margin: auto;
  431. }
  432. }
  433. .sl_references_search_hint-varDefault {
  434. position: absolute;
  435. bottom: -22px;
  436. left: -1px;
  437. right: 0px;
  438. text-align: center;
  439. padding: 2px;
  440. background: rgb(202, 214, 250);
  441. border: 1px solid lightgray;
  442. box-shadow: 3px 3px 5px rgba(0,0,0,.2);
  443. span {
  444. color: black;
  445. }
  446. }
  447. .sl_references_search_hint-varButton {
  448. position: absolute;
  449. bottom: -65px;
  450. left: -1px;
  451. right: 0px;
  452. padding: 0 6px 6px;
  453. text-align: center;
  454. background: #fbfbfb;
  455. color: #FFF;
  456. box-shadow: 3px 3px 5px rgba(0,0,0,.2);
  457. border-left: 1px solid lightgray;
  458. font-family: @font-family-sans-serif;
  459. font-size: 13px;
  460. font-weight: 600;
  461. hr {
  462. margin: 6px -6px;
  463. }
  464. button {
  465. width: 100%;
  466. font-size: inherit;
  467. line-height: 1.4;
  468. }
  469. span {
  470. padding-left: 10px;
  471. }
  472. kbd {
  473. display: block;
  474. font-family: inherit;
  475. font-size: 12px;
  476. font-weight: normal;
  477. }
  478. }
  479. // -- References Search Modal --
  480. .references-search-modal-backdrop {
  481. // don't grey out the editor when the
  482. // modal is active
  483. background-color: transparent;
  484. }
  485. .references-search-modal {
  486. // upgrade prompt
  487. .references-search-upgrade-prompt {
  488. padding: 24px;
  489. padding-bottom: 48px;
  490. .upgrade-prompt {
  491. text-align: center;
  492. width: 400px;
  493. padding-top: 14px;
  494. padding-bottom: 14px;
  495. padding-left: 38px;
  496. padding-right: 38px;
  497. margin: auto;
  498. background: white;
  499. opacity: 0.95;
  500. border-radius: 8px;
  501. .message {
  502. margin-top: 15px;
  503. &.call-to-action {
  504. font-weight: bold;
  505. }
  506. ul.list-unstyled {
  507. text-align: left;
  508. }
  509. }
  510. a.btn {
  511. opacity: 1.0;
  512. }
  513. }
  514. }
  515. .search-form {
  516. // position the spinner inside the input element
  517. i.fa-spinner {
  518. margin-top: -30px;
  519. }
  520. }
  521. .alert-danger {
  522. margin-top: 12px;
  523. margin-bottom: 0px;
  524. }
  525. // search result items list
  526. .search-results {
  527. font-size: 12px;
  528. .no-results-message {
  529. font-size: 16px;
  530. }
  531. .search-result-hit {
  532. &:hover {
  533. cursor: pointer;
  534. }
  535. border-bottom: 1px solid #ddd;
  536. padding: 8px;
  537. &:last-child {
  538. border-bottom: 1px solid transparent;
  539. }
  540. border-left: 4px solid transparent;
  541. &.selected-search-result-hit {
  542. background-color: @red;
  543. color: white;
  544. .hit-year.small {
  545. color: white;
  546. }
  547. .hit-journal.small {
  548. color: white;
  549. }
  550. }
  551. .hit-title {
  552. font-size: 1.3em;
  553. font-style: italic;
  554. }
  555. }
  556. }
  557. }
  558. .referencesImportModal {
  559. .referencesImportPreviewScroller {
  560. font-family: monospace;
  561. font-size: 0.8em;
  562. max-height: 360px;
  563. overflow: scroll;
  564. white-space: pre;
  565. padding: 8px 12px;
  566. margin-bottom: 15px;
  567. border: 1px solid @gray-lighter;
  568. background-color: @gray-lightest;
  569. }
  570. }
  571. .teaser-title,
  572. .dropbox-teaser-title {
  573. margin-top: 0;
  574. text-align: center;
  575. }
  576. .teaser-img,
  577. .dropbox-teaser-img {
  578. .img-responsive;
  579. margin-bottom: 5px;
  580. }
  581. .teaser-video-container,
  582. .dropbox-teaser-video-container {
  583. margin-top: -@modal-inner-padding;
  584. margin-left: -@modal-inner-padding;
  585. margin-right: -@modal-inner-padding;
  586. margin-bottom: 5px;
  587. overflow: hidden;
  588. }
  589. .teaser-video,
  590. .dropbox-teaser-video {
  591. width: 100%;
  592. height: auto;
  593. border-bottom: 1px solid @modal-header-border-color;
  594. }
  595. .spell-check-menu {
  596. > .dropdown-menu > li > a {
  597. padding: 2px 15px;
  598. }
  599. }
  600. .spell-check-menu-from-bottom {
  601. > .dropdown-menu {
  602. top: auto;
  603. bottom: 100%;
  604. }
  605. }