Skip to content

Commit

Permalink
Adds code styling options and fixes docs code (block) styling
Browse files Browse the repository at this point in the history
  • Loading branch information
HeleenSG committed Oct 3, 2024
1 parent 2e5e3e6 commit 875a99c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
8 changes: 0 additions & 8 deletions docs/src/lib/Code.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,3 @@
</script>

<pre><code>{@html highlighted}</code></pre>

<style>
code {
padding: 1rem;
overflow-x: auto;
background-color: #ffffff;
}
</style>
2 changes: 1 addition & 1 deletion manon/code-base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $breakpoint: 24rem !default;
color: var(--code-base-text-color, inherit);
width: 100%;
word-break: var(--code-base-word-break, inherit);
padding: var(--code-base-padding, inherit);
padding: var(--code-base-padding, 0);

@media (width >= $breakpoint) {
word-break: var(--code-base-breakpoint-word-break, break-word);
Expand Down
3 changes: 3 additions & 0 deletions manon/code-block.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pre,
div.code-block {
display: flex;
overflow: auto;
overflow-x: auto;
width: 100%;
max-width: var(--code-block-max-width);
box-sizing: border-box;
Expand All @@ -20,6 +21,8 @@ div.code-block {

> code {
white-space: unset;
background-color: var(--code-block-code-background-color);
padding: var(--code-block-code-padding);
}
}

Expand Down
3 changes: 3 additions & 0 deletions themes/icore-open/components/code.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@
--code-base-base-background-color: #{color-scheme.$oc-gray-1};
--code-base-base-text-color: var(--application-base-text-color);
--code-base-padding: 0 0.5rem;

--code-block-code-background-color: #fff;
--code-block-code-padding: 1rem;
}

0 comments on commit 875a99c

Please sign in to comment.