editor.less 12 KB

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