Skip to content

Commit

Permalink
Update markdown line height, sheodox-ui update for some other style u…
Browse files Browse the repository at this point in the history
…pdates
  • Loading branch information
sheodox committed Jul 13, 2023
1 parent ce9ea86 commit bbd7bdc
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 44 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@
"markdown-it-sub": "^1.0.0",
"markdown-it-sup": "^1.0.0",
"sass": "^1.63.6",
"sheodox-ui": "^0.19.25"
"sheodox-ui": "^0.19.26"
}
}
41 changes: 2 additions & 39 deletions src/lib/Markdown.svelte
Original file line number Diff line number Diff line change
@@ -1,42 +1,3 @@
<style lang="scss">
div :global(img) {
max-width: 100%;
cursor: zoom-out;
}
div :global(img:not(.show-full)) {
max-height: 40rem;
cursor: zoom-in;
}
div :global(code) {
word-wrap: break-word;
white-space: pre-wrap;
}
div :global(pre) {
background: var(--sx-gray-transparent);
border-radius: 5px;
padding: var(--sx-spacing-1);
:global(code) {
background: none;
}
}
div :global(summary) {
cursor: pointer;
border-radius: 5px;
}
div :global(details) {
padding: var(--sx-spacing-2);
border-radius: 5px;
}
div :global(hr) {
color: var(--sx-gray-transparent-lighter);
}
div :global(details[open]) {
background: var(--sx-gray-transparent);
}
</style>

<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div class="markdown-renderer has-inline-links" on:click={toggleFullSize}>
Expand All @@ -53,6 +14,8 @@
import mdi_ruby from 'markdown-it-ruby';
import { getAppContext } from './app-context';
import type Token from 'markdown-it/lib/token';
import './markdown.scss';
const mdOptions: Options = {
linkify: true,
html: false,
Expand Down
41 changes: 41 additions & 0 deletions src/lib/markdown.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.markdown-renderer {
p {
line-height: 1.6;
}
img {
max-width: 100%;
cursor: zoom-out;
}
img:not(.show-full) {
max-height: 40rem;
cursor: zoom-in;
}

code {
word-wrap: break-word;
white-space: pre-wrap;
}
pre {
background: var(--sx-gray-transparent);
border-radius: 5px;
padding: var(--sx-spacing-1);

code {
background: none;
}
}
summary {
cursor: pointer;
border-radius: 5px;
}
details {
padding: var(--sx-spacing-2);
border-radius: 5px;
}
hr {
color: var(--sx-gray-transparent-lighter);
}
details[open] {
background: var(--sx-gray-transparent);
}
}

0 comments on commit bbd7bdc

Please sign in to comment.