Skip to content

import '../app.css';, Dark Mode, and const ssr = false; - background-color blink #6564

Discussion options

You must be logged in to vote

The simplest solution to the problem (although I haven't tested it much):

<!-- src/routes/+layout.svelte -->
<script>
  import '../app.css';
  import { browser } from "$app/environment";
</script>

{#if browser}
  <slot />
{/if}

And src/routes/+layout.svelte with export const ssr = true; (as it is by default).

It hadn't occurred to me before.... :D

Replies: 6 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@lukaszpolowczyk
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@jdgamble555
Comment options

@lukaszpolowczyk
Comment options

@jdgamble555
Comment options

Answer selected by lukaszpolowczyk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants