editor.less 12 KB

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