Skip to content

Commit

Permalink
style: code on light
Browse files Browse the repository at this point in the history
  • Loading branch information
ivynya committed Dec 25, 2023
1 parent defc83c commit 7c186d5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
hljs.highlightAll();
}
});
socket.addEventListener("close", async (event) => {
connect();
});
}
async function submit() {
Expand Down
9 changes: 8 additions & 1 deletion src/routes/Message.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import { marked } from "marked";
import { fade } from "svelte/transition";
import { isLight } from "@ivynya/leaf";
import type { ChatMessage } from "$lib/schema";
export let message: ChatMessage;
Expand All @@ -25,7 +26,7 @@
{#if message.text.length === 0}
<div class="loading">parsing context...</div>
{:else}
<div>{@html marked.parse(message.text)}</div>
<div class:isLight={$isLight}>{@html marked.parse(message.text)}</div>
{/if}
</div>

Expand Down Expand Up @@ -127,6 +128,12 @@
overflow-x: auto;
font-family: cartograph-cf, monospace;
}
.msg .isLight :global(pre),
.msg .isLight :global(code) {
background-color: #2E3440;
color: #D8DEE9;
}
.msg :global(pre) {
margin: 0;
Expand Down

0 comments on commit 7c186d5

Please sign in to comment.