editor.less 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  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. @import "./editor/publish-modal.less";
  17. @ui-layout-toggler-def-height: 50px;
  18. @ui-resizer-size: 7px;
  19. @keyframes blink {
  20. 0% {
  21. opacity: 0.2;
  22. }
  23. 20% {
  24. opacity: 1;
  25. }
  26. 100% {
  27. opacity: 0.2;
  28. }
  29. }
  30. .editor-menu-icon when (@is-overleaf = true) {
  31. &.fa {
  32. width: 1em;
  33. background: url(/img/ol-brand/overleaf-o-white.svg) center / contain no-repeat;
  34. &::before {
  35. // Disable the font-awesome icon when in Overleaf by replacing it with a
  36. // non-breakable space instead (otherwise the browser would render a
  37. // zero-width element).
  38. content: "\00a0";
  39. }
  40. }
  41. }
  42. .full-size {
  43. position: absolute;
  44. top: 0;
  45. bottom: 0;
  46. left: 0;
  47. right: 0;
  48. }
  49. .global-alerts {
  50. height: 0;
  51. margin-top: 2px;
  52. text-align: center;
  53. .alert {
  54. display: inline-block;
  55. text-align: left;
  56. min-width: 400px;
  57. padding: @global-alerts-padding;
  58. font-size: 14px;
  59. margin-bottom: (@line-height-computed / 4);
  60. position: relative;
  61. z-index: 20;
  62. }
  63. }
  64. #try-reconnect-now-button {
  65. margin-left: 20px;
  66. }
  67. #ide-body {
  68. .full-size;
  69. top: 40px;
  70. }
  71. #editor, #editor-rich-text {
  72. .full-size;
  73. }
  74. #editor-rich-text {
  75. top: @editor-toolbar-height;
  76. }
  77. .toolbar-editor {
  78. height: @editor-toolbar-height;
  79. background-color: @editor-toolbar-bg;
  80. }
  81. .loading-screen {
  82. display: flex;
  83. flex-direction: column;
  84. justify-content: center;
  85. align-items: center;
  86. width: 100%;
  87. height: 100%;
  88. background-color: #FFF;
  89. }
  90. .loading-screen-brand-container {
  91. width: 15%;
  92. min-width: 200px;
  93. text-align: center;
  94. }
  95. .loading-screen-brand {
  96. position: relative;
  97. width: 100%;
  98. padding-top: @editor-loading-logo-padding-top;
  99. height: 0;
  100. background: @editor-loading-logo-background-url no-repeat bottom / 100%;
  101. &::after {
  102. content: '';
  103. position: absolute;
  104. height: inherit;
  105. right: 0;
  106. bottom: 0;
  107. left: 0;
  108. background: @editor-loading-logo-foreground-url no-repeat bottom / 100%;
  109. transition: height .5s;
  110. }
  111. }
  112. .loading-screen-label {
  113. margin: 0;
  114. padding-top: 1em;
  115. font-size: 2em;
  116. color: @gray-dark;
  117. }
  118. .loading-screen-ellip {
  119. animation: blink 1.4s both infinite;
  120. &:nth-child(2) {
  121. animation-delay: 0.2s;
  122. }
  123. &:nth-child(3) {
  124. animation-delay: 0.4s;
  125. }
  126. }
  127. .loading-screen-error {
  128. margin: 0;
  129. padding-top: 1em;
  130. color: @state-danger-text;
  131. }
  132. .loading-panel {
  133. .full-size;
  134. padding-top: 10rem;
  135. font-family: @font-family-serif;
  136. text-align: center;
  137. background-color: #fafafa;
  138. }
  139. .error-panel {
  140. .full-size;
  141. padding: @line-height-computed;
  142. background-color: #fafafa;
  143. .alert {
  144. max-width: 400px;
  145. margin: auto;
  146. }
  147. }
  148. .project-name {
  149. .name {
  150. display: inline-block;
  151. max-width: 250px;
  152. overflow: hidden;
  153. text-overflow: ellipsis;
  154. vertical-align: top;
  155. padding: 6px;
  156. color: @project-name-color;
  157. font-weight: 700;
  158. white-space: nowrap;
  159. }
  160. input {
  161. height: 30px;
  162. margin-top: 4px;
  163. text-align: center;
  164. padding: 6px;
  165. font-weight: 700;
  166. }
  167. a.rename {
  168. visibility: hidden;
  169. display: inline-block;
  170. color: @project-rename-link-color;
  171. padding: 5px;
  172. border-radius: @border-radius-small;
  173. &:hover {
  174. text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  175. color: @project-rename-link-color-hover;
  176. text-decoration: none;
  177. }
  178. }
  179. &:hover {
  180. a.rename {
  181. visibility: visible;
  182. }
  183. }
  184. }
  185. /**************************************
  186. Ace
  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. /**************************************
  259. CodeMirror
  260. ***************************************/
  261. .cm-editor-wrapper {
  262. position: relative;
  263. height: 100%;
  264. }
  265. .cm-editor-body {
  266. height: 100%;
  267. }
  268. // CM (for some reason) has height set to 300px in it's stylesheet
  269. .CodeMirror {
  270. height: 100%;
  271. }
  272. .ui-layout-resizer when (@is-overleaf = false) {
  273. width: 6px;
  274. background-color: @editor-resizer-bg-color;
  275. border-left: 1px solid @editor-border-color;
  276. border-right: 1px solid @editor-border-color;
  277. .ui-layout-toggler {
  278. color: #999;
  279. font-family: FontAwesome;
  280. font-style: normal;
  281. font-weight: normal;
  282. line-height: 1;
  283. -webkit-font-smoothing: antialiased;
  284. -moz-osx-font-smoothing: grayscale;
  285. font-size: 16px !important;
  286. line-height: 50px;
  287. background-color: @editor-toggler-bg-color;
  288. &:hover {
  289. background-color: @editor-toggler-hover-bg-color;
  290. color: #333;
  291. }
  292. }
  293. }
  294. .ui-layout-resizer when (@is-overleaf = true) {
  295. width: @ui-resizer-size !important;
  296. background-color: @editor-resizer-bg-color;
  297. &.ui-layout-resizer-closed {
  298. &::before,
  299. &::after {
  300. content: none;
  301. }
  302. }
  303. &::before,
  304. &::after {
  305. content: '\2847';
  306. display: block;
  307. position: absolute;
  308. text-align: center;
  309. left: -2px;
  310. -webkit-font-smoothing: antialiased;
  311. width: 100%;
  312. font-size: 24px;
  313. top: 25%;
  314. color: @ol-blue-gray-2;
  315. }
  316. &::after {
  317. top: 75%;
  318. }
  319. }
  320. .ui-layout-resizer-west.ui-layout-resizer-open, .ui-layout-resizer-east.ui-layout-resizer-closed {
  321. .ui-layout-toggler when (@is-overleaf = false) {
  322. &:before {
  323. content: "\f104"
  324. }
  325. }
  326. }
  327. .ui-layout-resizer-east.ui-layout-resizer-open, .ui-layout-resizer-west.ui-layout-resizer-closed {
  328. .ui-layout-toggler when (@is-overleaf = false) {
  329. &:before {
  330. content: "\f105"
  331. }
  332. }
  333. }
  334. .ui-layout-toggler when (@is-overleaf = true) {
  335. display: none !important;
  336. }
  337. .custom-toggler when (@is-overleaf = true) {
  338. position: absolute;
  339. display: flex;
  340. align-items: center;
  341. justify-content: center;
  342. width: @ui-resizer-size !important;;
  343. height: 50px;
  344. margin-top: -25px;
  345. top: 50%;
  346. z-index: 6;
  347. background-color: @editor-toggler-bg-color;
  348. &:hover,
  349. &:focus {
  350. outline: none;
  351. text-decoration: none;
  352. }
  353. // Increase hit area
  354. &::before {
  355. content: '';
  356. display: block;
  357. position: absolute;
  358. top: 0;
  359. right: -3px;
  360. bottom: 0;
  361. left: -3px;
  362. }
  363. &::after {
  364. font-family: FontAwesome;
  365. -webkit-font-smoothing: antialiased;
  366. -moz-osx-font-smoothing: grayscale;
  367. font-size: 65%;
  368. font-weight: bold;
  369. color: #FFF;
  370. user-select: none;
  371. pointer-events: none;
  372. }
  373. &:hover {
  374. background-color: @editor-toggler-hover-bg-color;
  375. }
  376. }
  377. .custom-toggler-east::after {
  378. content: '\f105';
  379. }
  380. .custom-toggler-west::after {
  381. content: '\f104';
  382. }
  383. .custom-toggler-closed.custom-toggler-east::after {
  384. content: '\f104';
  385. }
  386. .custom-toggler-closed.custom-toggler-west::after {
  387. content: '\f105';
  388. }
  389. .ui-layout-resizer-dragging {
  390. background-color: @editor-resizer-bg-color-dragging;
  391. }
  392. .context-menu {
  393. position: fixed;
  394. z-index: 100;
  395. }
  396. .editor-dark {
  397. color: @gray-lighter;
  398. background-color: @editor-dark-background-color;
  399. .ui-layout-resizer {
  400. background-color: darken(@editor-dark-background-color, 10%);
  401. border: none;
  402. }
  403. .btn-default {
  404. color: white;
  405. background-color: @gray;
  406. border-color: darken(@gray-dark, 10%);
  407. &:hover {
  408. background-color: darken(@gray, 5%);
  409. border-color: darken(@gray-dark, 20%);
  410. }
  411. }
  412. }
  413. .modal-alert {
  414. margin-top:10px;
  415. margin-bottom:0px;
  416. }
  417. // vertically centre the "connection down" modal so it does not hide
  418. // the reconnecting indicator
  419. .modal.lock-editor-modal {
  420. display: flex !important;
  421. .modal-dialog {
  422. margin: auto;
  423. }
  424. }
  425. .sl_references_search_hint-varDefault {
  426. position: absolute;
  427. bottom: -22px;
  428. left: -1px;
  429. right: 0px;
  430. text-align: center;
  431. padding: 2px;
  432. background: rgb(202, 214, 250);
  433. border: 1px solid lightgray;
  434. box-shadow: 3px 3px 5px rgba(0,0,0,.2);
  435. span {
  436. color: black;
  437. }
  438. }
  439. .sl_references_search_hint-varButton {
  440. position: absolute;
  441. bottom: -65px;
  442. left: -1px;
  443. right: 0px;
  444. padding: 0 6px 6px;
  445. text-align: center;
  446. background: #fbfbfb;
  447. color: #FFF;
  448. box-shadow: 3px 3px 5px rgba(0,0,0,.2);
  449. border-left: 1px solid lightgray;
  450. font-family: @font-family-sans-serif;
  451. font-size: 13px;
  452. font-weight: 600;
  453. hr {
  454. margin: 6px -6px;
  455. }
  456. button {
  457. width: 100%;
  458. font-size: inherit;
  459. line-height: 1.4;
  460. }
  461. span {
  462. padding-left: 10px;
  463. }
  464. kbd {
  465. display: block;
  466. font-family: inherit;
  467. font-size: 12px;
  468. font-weight: normal;
  469. }
  470. }
  471. // -- References Search Modal --
  472. .references-search-modal-backdrop {
  473. // don't grey out the editor when the
  474. // modal is active
  475. background-color: transparent;
  476. }
  477. .references-search-modal {
  478. // upgrade prompt
  479. .references-search-upgrade-prompt {
  480. padding: 24px;
  481. padding-bottom: 48px;
  482. .upgrade-prompt {
  483. text-align: center;
  484. width: 400px;
  485. padding-top: 14px;
  486. padding-bottom: 14px;
  487. padding-left: 38px;
  488. padding-right: 38px;
  489. margin: auto;
  490. background: white;
  491. opacity: 0.95;
  492. border-radius: 8px;
  493. .message {
  494. margin-top: 15px;
  495. &.call-to-action {
  496. font-weight: bold;
  497. }
  498. ul.list-unstyled {
  499. text-align: left;
  500. }
  501. }
  502. a.btn {
  503. opacity: 1.0;
  504. }
  505. }
  506. }
  507. .search-form {
  508. // position the spinner inside the input element
  509. i.fa-spinner {
  510. margin-top: -30px;
  511. }
  512. }
  513. .alert-danger {
  514. margin-top: 12px;
  515. margin-bottom: 0px;
  516. }
  517. // search result items list
  518. .search-results {
  519. font-size: 12px;
  520. .no-results-message {
  521. font-size: 16px;
  522. }
  523. .search-result-hit {
  524. &:hover {
  525. cursor: pointer;
  526. }
  527. border-bottom: 1px solid #ddd;
  528. padding: 8px;
  529. &:last-child {
  530. border-bottom: 1px solid transparent;
  531. }
  532. border-left: 4px solid transparent;
  533. &.selected-search-result-hit {
  534. background-color: @red;
  535. color: white;
  536. .hit-year.small {
  537. color: white;
  538. }
  539. .hit-journal.small {
  540. color: white;
  541. }
  542. }
  543. .hit-title {
  544. font-size: 1.3em;
  545. font-style: italic;
  546. }
  547. }
  548. }
  549. }
  550. .referencesImportModal {
  551. .referencesImportPreview {
  552. margin-top: 15px;
  553. .referencesImportPreviewScroller {
  554. font-family: monospace;
  555. font-size: 0.8em;
  556. max-height: 360px;
  557. overflow: scroll;
  558. white-space: pre;
  559. padding: 8px 12px;
  560. margin-bottom: 15px;
  561. border: 1px solid @gray-lighter;
  562. background-color: @gray-lightest;
  563. }
  564. }
  565. }
  566. .teaser-title,
  567. .dropbox-teaser-title {
  568. margin-top: 0;
  569. text-align: center;
  570. }
  571. .teaser-img,
  572. .dropbox-teaser-img {
  573. .img-responsive;
  574. margin-bottom: 5px;
  575. }
  576. .teaser-video-container,
  577. .dropbox-teaser-video-container {
  578. margin-top: -@modal-inner-padding;
  579. margin-left: -@modal-inner-padding;
  580. margin-right: -@modal-inner-padding;
  581. margin-bottom: 5px;
  582. overflow: hidden;
  583. }
  584. .teaser-video,
  585. .dropbox-teaser-video {
  586. width: 100%;
  587. height: auto;
  588. border-bottom: 1px solid @modal-header-border-color;
  589. }