editor.less 12 KB

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