editor.less 12 KB

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