editor.less 12 KB

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