editor.less 12 KB

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