Skip to content

Commit

Permalink
change theme
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte committed Oct 23, 2024
1 parent 90d9b6d commit ae8336e
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
5 changes: 2 additions & 3 deletions sites/docs/mdsx.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const __dirname = fileURLToPath(new URL(".", import.meta.url));
* @type {import('rehype-pretty-code').Options}
*/
const prettyCodeOptions = {
theme: JSON.parse(String(readFileSync(resolve(__dirname, "./other/themes/dark.json")))),
theme: "github-dark",
getHighlighter: (options) =>
getHighlighter({
...options,
Expand All @@ -45,8 +45,7 @@ const prettyCodeOptions = {
keepBackground: false,
onVisitLine(node) {
if (node.children.length === 0) {
// @ts-expect-error - we're changing the node type
node.children = { type: "text", value: " " };
console.log(JSON.stringify(node));
}
},
onVisitHighlightedLine(node) {
Expand Down
5 changes: 5 additions & 0 deletions sites/docs/src/content/components/sidebar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Sidebar
description: A composable, themeable and customizable sidebar component.
component: true
---
1 change: 1 addition & 0 deletions sites/docs/src/lib/components/docs/copy-button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
variant="ghost"
class={cn(
"bg-background/10 text-background/70 hover:bg-background/20 hover:text-background/80 dark:bg-foreground/5 dark:text-foreground/70 dark:hover:bg-foreground/10 dark:hover:text-foreground/80 relative !right-12 h-6 w-fit items-center justify-center rounded-md p-1",
"hidden sm:inline-flex",
className
)}
{...restProps}
Expand Down
17 changes: 6 additions & 11 deletions sites/docs/src/lib/components/docs/pm-block.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,21 @@
</script>

<figure data-rehype-pretty-code-figure>
<Pre
isPackageManagerBlock={true}
tabindex={0}
data-language="bash"
data-theme="Lambda Studio - Blackout"
>
<code data-language="bash" data-theme="Lambda Studio — Blackout" style="display: grid;">
<Pre isPackageManagerBlock={true} tabindex={0} data-language="bash" data-theme="github-dark">
<code data-language="bash" data-theme="github-dark" style="display: grid;">
<span data-line>
<span style="color:#FFF;font-weight:bold">{`${cmdStart}`}</span>
<span style="color:#B392F0;font-weight:bold">{`${cmdStart}`}</span>
{#if type === "install" || type === "create"}
<span style="color:#FFF8">
<span style="color:#9ECBFF">
{`${type === "install" ? getInstallCommand() : "create"}${command === "" ? "" : ` `}`}
</span>
{/if}
{#if command !== ""}
{#each command.split(" ") as word, i}
{#if i === 0}
<span style="color:#FFF8; margin-left:-8px">{`${word}`}</span>
<span style="color:#9ECBFF; margin-left:-8px">{`${word}`}</span>
{:else}
<span style="color:#FFF8">{` ${word}`}</span>
<span style="color:#9ECBFF">{` ${word}`}</span>
{/if}
{/each}
{/if}
Expand Down
2 changes: 1 addition & 1 deletion sites/docs/src/lib/components/docs/style-switcher.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
...restProps
}: WithoutChildren<Omit<PrimitiveButtonAttributes, "style" | "id">> = $props();
const styleLabel = $derived(styles.filter((s) => s.name === $config.style)[0].label);
const styleLabel = $derived(styles.filter((s) => s.name === $config.style)[0]?.label);
let value = $state($config.style);
Expand Down
6 changes: 3 additions & 3 deletions sites/docs/src/styles/markdown.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@apply bg-muted relative rounded px-[0.3rem] py-[0.2rem] font-mono text-sm;
}

[data-theme*=" "] {
[data-theme*="github-dark"] {
display: flex !important;
flex-direction: column;
}
Expand Down Expand Up @@ -92,8 +92,8 @@
@apply mt-2;
}

code[data-theme*=" "],
code[data-theme*=" "] span {
code[data-theme*="github-dark"],
code[data-theme*="github-dark"] span {
color: var(--shiki-light);
background-color: var(--shiki-light-bg);
}

0 comments on commit ae8336e

Please sign in to comment.