@sobagu/svelte
v0.1.2
Published
Sobagu CSS for Svelte 5: the use:sb action, plus css and cx for class={...}
Maintainers
Readme
@sobagu/svelte
Sobagu for Svelte 5: the use:sb action styles any element with a style object, and css() /
cx() return class strings for class={...} (which also works during SSR).
Install
npm i @sobagu/svelteNeeds Svelte 5. @sobagu/core is installed with it.
Usage
<script>
import { sb, css } from '@sobagu/svelte'
let saving = $state(false)
</script>
<section class={css({ card: true, md: { p: 'lg' } })}>
<button use:sb={{ p: 'md', _disabled: { opacity: 0.5 } }} disabled={saving} onclick={() => (saving = true)}>
Save
</button>
</section>Actions only run in the browser. With SvelteKit SSR, use class={css(...)} for anything that must be
styled in the server HTML.
Docs
Sobagu is in 0.x: the API can still change between minor versions.
Licence
MIT © 2026 Sobagu contributors
