Change body class via <svelte:body />
See original GitHub issueIt’s just an idea, but it’ll be very convenient if we’ll able to switch classes on body element like this:
<svelte:body class:profile={isProfilePage} />
Issue Analytics
- State:
- Created 4 years ago
- Reactions:304
- Comments:52 (7 by maintainers)
Top Results From Across the Web
Svelte: add noscroll classname to body from component
In your Sidebar.svelte you add a reactive function that toggles the classname export let toggle; $: document.body.classList[toggle ?
Read more >Change body class via <svelte:body /> - Bountysource
Change body class via <svelte:body /> · Overview · Backers (0) · Updates ...
Read more >Changing HTML Class in Svelte Components with ... - Medium
In this article, we'll look at how to change class names dynamically with the Svelte class directive. We can use the class directive...
Read more >Cascade, specificity, and inheritance - Learn web development
As the body has been set to have a color of blue this is inherited through the descendants. We can change the color...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
+1 for
as well as
vote positive on <svelte:body class:name={confition} is usefull