
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
svelte-body
Advanced tools
Apply styles to the body in routes! Designed to work with Svelte Kit and Routify.
Apply styles to the body in routes! Designed to work with Svelte Kit and Routify.
Currently in Svelte Kit and Routify, applying styles per page to the body doesn't work. You can't use :global(body)
since the style tags aren't removed and reapplied on route change. svelte-body
handles that for you!
npm i svelte-body -D
Just like in regular html you can apply classes with class=""
and styles with style=""
.
<script>
import { Body } from 'svelte-body';
</script>
<Body class="some classes" style="color: blue" />
Alternativley you can use a style object like so:
<script>
import { Body } from 'svelte-body';
const style = {
"background-color": "violet",
"color": "white"
}
</script>
<Body {style} />
There are also svelte actions that can be used on <svelte:body />
:
classList
<script>
import { classList } from 'svelte/body';
</script>
<svelte:body use:classList={"red green blue"}>
style
<script>
import { style } from 'svelte/body';
</script>
<svelte:body use:style={"background-color: blue;"}>
FAQs
Apply styles to the body in routes! Designed to work with Svelte Kit and Routify.
The npm package svelte-body receives a total of 1,216 weekly downloads. As such, svelte-body popularity was classified as popular.
We found that svelte-body demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.