Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change font color #67

Open
StathisKap opened this issue Mar 23, 2023 · 1 comment
Open

How to change font color #67

StathisKap opened this issue Mar 23, 2023 · 1 comment

Comments

@StathisKap
Copy link

I have a dark theme website right now, but when I try and use everything is dark text on my dark background. If I try and add a tailwind class of text-gray-100, then it changes most of the text, but none of the heading or the code blocks. Any way to fix this?

@khromov
Copy link

khromov commented Jul 9, 2023

Here is an example how to change the text color on the default text. You will need to adapt it to add the correct classes based on where you get the theme from:

<!-- $lib/Text.svelte -->

<span><slot /></span>

<style>
    span {
        color: red; /* Use a CSS var or add classes depending on some context instead */
    }
</style>

Then configure it in the library:

<script>
    import Text from '$lib/Text.svelte';
</script>
<SvelteMarkdown
	source={"Hello world"}
	renderers={{
		text: Text
       }}
/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants