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

<svelte:body/> Allow adding classes to the body tag #8058

Closed
Bradley-H opened this issue Nov 26, 2022 · 1 comment
Closed

<svelte:body/> Allow adding classes to the body tag #8058

Bradley-H opened this issue Nov 26, 2022 · 1 comment

Comments

@Bradley-H
Copy link

Bradley-H commented Nov 26, 2022

Describe the problem

This should be a rather straight forward answer, as far as i'm aware the only way to add classes, id's to the body tag is to do an onMount(() =>{
const body = document.querySelector("body").
// apply logic here
})

And if you are using dynamic classes you're going to have to add a bunch of if statements that is tedious

Describe the proposed solution

My solution I think quite simple

instead of the above, we do this

<Svelte:body class="{whatever}"/>

Alternatives considered

N/A

Importance

would make my life easier

@PatrickG
Copy link
Member

Duplicate #3105

Please search the open issues before submitting a new one.

@dummdidumm dummdidumm closed this as not planned Won't fix, can't repro, duplicate, stale Nov 26, 2022
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

3 participants