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