editor.less 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  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-extra-hit-area: 8px;
  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. margin-left: -(@ui-resizer-extra-hit-area) !important;
  282. margin-right: -(@ui-resizer-extra-hit-area - 1px) !important;
  283. padding-left: @ui-resizer-extra-hit-area !important;
  284. padding-right: @ui-resizer-extra-hit-area !important;
  285. z-index: 5 !important;
  286. box-sizing: content-box;
  287. background-image: linear-gradient(90deg,
  288. transparent,
  289. transparent (@ui-resizer-extra-hit-area - 1px),
  290. @editor-resizer-bg-color (@ui-resizer-extra-hit-area - 1px),
  291. @editor-resizer-bg-color (@ui-resizer-extra-hit-area + 1px),
  292. transparent (@ui-resizer-extra-hit-area + 1px),
  293. transparent);
  294. .ui-layout-toggler {
  295. padding: 0 @ui-resizer-extra-hit-area !important;
  296. background-image: linear-gradient(90deg,
  297. transparent,
  298. transparent (@ui-resizer-extra-hit-area - 1px),
  299. @editor-toggler-bg-color (@ui-resizer-extra-hit-area - 1px),
  300. @editor-toggler-bg-color (@ui-resizer-extra-hit-area + 1px),
  301. transparent (@ui-resizer-extra-hit-area + 1px),
  302. transparent);
  303. &:hover {
  304. background-image: linear-gradient(90deg,
  305. transparent,
  306. transparent (@ui-resizer-extra-hit-area - 2px),
  307. @editor-toggler-hover-bg-color (@ui-resizer-extra-hit-area - 2px),
  308. @editor-toggler-hover-bg-color (@ui-resizer-extra-hit-area + 2px),
  309. transparent (@ui-resizer-extra-hit-area + 2px),
  310. transparent);
  311. }
  312. }
  313. }
  314. .ui-layout-resizer-west.ui-layout-resizer-open, .ui-layout-resizer-east.ui-layout-resizer-closed {
  315. .ui-layout-toggler when (@is-overleaf = false) {
  316. &:before {
  317. content: "\f104"
  318. }
  319. }
  320. }
  321. .ui-layout-resizer-east.ui-layout-resizer-open, .ui-layout-resizer-west.ui-layout-resizer-closed {
  322. .ui-layout-toggler when (@is-overleaf = false) {
  323. &:before {
  324. content: "\f105"
  325. }
  326. }
  327. }
  328. .ui-layout-toggler.ui-layout-toggler-closed when (@is-overleaf = true) {
  329. background-color: @editor-resizer-bg-color;
  330. background-image: none;
  331. line-height: @ui-layout-toggler-def-height;
  332. &::before {
  333. content: "\22EE"; // Vertical ellipsis
  334. display: block;
  335. color: #FFF;
  336. font-weight: 700;
  337. font-size: @font-size-h2;
  338. width: @ui-resizer-extra-hit-area / 2;
  339. }
  340. &:hover {
  341. background-color: @editor-toggler-hover-bg-color;
  342. background-image: none;
  343. }
  344. .ui-layout-resizer-west > & {
  345. border-radius: 0 @border-radius-base @border-radius-base 0;
  346. &::before {
  347. margin-left: -2px;
  348. }
  349. }
  350. .ui-layout-resizer-east > & {
  351. border-radius: @border-radius-base 0 0 @border-radius-base;
  352. &::before {
  353. margin-left: (-1 - @ui-resizer-extra-hit-area);
  354. }
  355. }
  356. }
  357. .ui-layout-toggler-east when (@is-overleaf = true) {
  358. &.ui-layout-toggler-open {
  359. cursor: e-resize !important
  360. }
  361. &.ui-layout-toggler-closed {
  362. cursor: w-resize !important
  363. }
  364. }
  365. .ui-layout-toggler-west when (@is-overleaf = true) {
  366. &.ui-layout-toggler-open {
  367. cursor: w-resize !important
  368. }
  369. &.ui-layout-toggler-closed {
  370. cursor: e-resize !important
  371. }
  372. }
  373. .ui-layout-resizer-dragging {
  374. background-color: @editor-resizer-bg-color-dragging;
  375. }
  376. .context-menu {
  377. position: fixed;
  378. z-index: 100;
  379. }
  380. .editor-dark {
  381. color: @gray-lighter;
  382. background-color: @editor-dark-background-color;
  383. .ui-layout-resizer {
  384. background-color: darken(@editor-dark-background-color, 10%);
  385. border: none;
  386. }
  387. .btn-default {
  388. color: white;
  389. background-color: @gray;
  390. border-color: darken(@gray-dark, 10%);
  391. &:hover {
  392. background-color: darken(@gray, 5%);
  393. border-color: darken(@gray-dark, 20%);
  394. }
  395. }
  396. }
  397. .modal-alert {
  398. margin-top:10px;
  399. margin-bottom:0px;
  400. }
  401. // vertically centre the "connection down" modal so it does not hide
  402. // the reconnecting indicator
  403. .modal.lock-editor-modal {
  404. display: flex !important;
  405. .modal-dialog {
  406. margin: auto;
  407. }
  408. }
  409. .sl_references_search_hint-varDefault {
  410. position: absolute;
  411. bottom: -22px;
  412. left: -1px;
  413. right: 0px;
  414. text-align: center;
  415. padding: 2px;
  416. background: rgb(202, 214, 250);
  417. border: 1px solid lightgray;
  418. box-shadow: 3px 3px 5px rgba(0,0,0,.2);
  419. span {
  420. color: black;
  421. }
  422. }
  423. .sl_references_search_hint-varButton {
  424. position: absolute;
  425. bottom: -65px;
  426. left: -1px;
  427. right: 0px;
  428. padding: 0 6px 6px;
  429. text-align: center;
  430. background: #fbfbfb;
  431. color: #FFF;
  432. box-shadow: 3px 3px 5px rgba(0,0,0,.2);
  433. border-left: 1px solid lightgray;
  434. font-family: @font-family-sans-serif;
  435. font-size: 13px;
  436. font-weight: 600;
  437. hr {
  438. margin: 6px -6px;
  439. }
  440. button {
  441. width: 100%;
  442. font-size: inherit;
  443. line-height: 1.4;
  444. }
  445. span {
  446. padding-left: 10px;
  447. }
  448. kbd {
  449. display: block;
  450. font-family: inherit;
  451. font-size: 12px;
  452. font-weight: normal;
  453. }
  454. }
  455. // -- References Search Modal --
  456. .references-search-modal-backdrop {
  457. // don't grey out the editor when the
  458. // modal is active
  459. background-color: transparent;
  460. }
  461. .references-search-modal {
  462. // upgrade prompt
  463. .references-search-upgrade-prompt {
  464. padding: 24px;
  465. padding-bottom: 48px;
  466. .upgrade-prompt {
  467. text-align: center;
  468. width: 400px;
  469. padding-top: 14px;
  470. padding-bottom: 14px;
  471. padding-left: 38px;
  472. padding-right: 38px;
  473. margin: auto;
  474. background: white;
  475. opacity: 0.95;
  476. border-radius: 8px;
  477. .message {
  478. margin-top: 15px;
  479. &.call-to-action {
  480. font-weight: bold;
  481. }
  482. ul.list-unstyled {
  483. text-align: left;
  484. }
  485. }
  486. a.btn {
  487. opacity: 1.0;
  488. }
  489. }
  490. }
  491. .search-form {
  492. // position the spinner inside the input element
  493. i.fa-spinner {
  494. margin-top: -30px;
  495. }
  496. }
  497. .alert-danger {
  498. margin-top: 12px;
  499. margin-bottom: 0px;
  500. }
  501. // search result items list
  502. .search-results {
  503. font-size: 12px;
  504. .no-results-message {
  505. font-size: 16px;
  506. }
  507. .search-result-hit {
  508. &:hover {
  509. cursor: pointer;
  510. }
  511. border-bottom: 1px solid #ddd;
  512. padding: 8px;
  513. &:last-child {
  514. border-bottom: 1px solid transparent;
  515. }
  516. border-left: 4px solid transparent;
  517. &.selected-search-result-hit {
  518. background-color: @red;
  519. color: white;
  520. .hit-year.small {
  521. color: white;
  522. }
  523. .hit-journal.small {
  524. color: white;
  525. }
  526. }
  527. .hit-title {
  528. font-size: 1.3em;
  529. font-style: italic;
  530. }
  531. }
  532. }
  533. }
  534. .referencesImportModal {
  535. .referencesImportPreview {
  536. margin-top: 15px;
  537. .referencesImportPreviewScroller {
  538. font-family: monospace;
  539. font-size: 0.8em;
  540. max-height: 360px;
  541. overflow: scroll;
  542. white-space: pre;
  543. padding: 8px 12px;
  544. margin-bottom: 15px;
  545. border: 1px solid @gray-lighter;
  546. background-color: @gray-lightest;
  547. }
  548. }
  549. }
  550. .teaser-title,
  551. .dropbox-teaser-title {
  552. margin-top: 0;
  553. text-align: center;
  554. }
  555. .teaser-img,
  556. .dropbox-teaser-img {
  557. .img-responsive;
  558. margin-bottom: 5px;
  559. }
  560. .teaser-video-container,
  561. .dropbox-teaser-video-container {
  562. margin-top: -@modal-inner-padding;
  563. margin-left: -@modal-inner-padding;
  564. margin-right: -@modal-inner-padding;
  565. margin-bottom: 5px;
  566. overflow: hidden;
  567. }
  568. .teaser-video,
  569. .dropbox-teaser-video {
  570. width: 100%;
  571. height: auto;
  572. border-bottom: 1px solid @modal-header-border-color;
  573. }