editor.less 12 KB

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