editor.less 12 KB

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