sobagu
v0.1.2
Published
Sobagu CSS with no build step: add one <script> tag and style plain HTML with sb="card p=lg md:cols=3"
Maintainers
Readme
sobagu
Sobagu with no build step. Add one <script> tag and style plain HTML with an sb attribute:
sb="card p=lg md:cols=3". It works well for prototypes, static pages, CMS themes and htmx or Alpine
projects. Elements added later are styled automatically, and changing an sb attribute updates the
styles. Prefer valid HTML? Use data-sb="…".
Install
From a CDN:
<script src="https://cdn.jsdelivr.net/npm/sobagu"></script>Or from npm, as an ES module: npm i sobagu.
Usage
<script src="https://cdn.jsdelivr.net/npm/sobagu"></script>
<div sb="card hover:shadow=lg">
<h2 sb="text=xl weight=bold">Hello</h2>
<p sb="muted">Styled with one attribute.</p>
<button sb="px=lg py=sm radius=md bg=primary color=onPrimary md:px=xl">Save</button>
</div>From a bundler, start it yourself: import { start, css } from 'sobagu', then call start() once
the page is ready. window.sobagu (script tag) and the module export everything from
@sobagu/core plus parse, apply, scan, observe and start.
Docs
- No build (script tag): the
sbsyntax and the JavaScript API
Sobagu is in 0.x: the API can still change between minor versions.
Licence
MIT © 2026 Sobagu contributors
