Overview
@codeui/styles v0.3.0
Inkstone styles as plain CSS, for HTML pages and any framework.
@codeui/styles is the stylesheet behind @codeui/solid, published on its own. It ships standard CSS files, cui- class names, data-* variant attributes, and small class helpers. It has no framework peer and no runtime that injects styles.
<form class="cui-stack" data-gap="4" style="max-width: 360px; margin-inline: auto"> <div class="cui-stack" data-gap="1"> <h2 class="cui-text" data-size="lg" data-weight="semibold" style="margin: 0">Export snippet</h2> <p class="cui-text" data-tone="muted" style="margin: 0">This form is plain HTML and one stylesheet.</p> </div> <div role="group" class="cui-textfield cui-field" data-cui="textfield" data-field-size="sm"> <label for="file-name" class="cui-field-label" data-cui="textfield-label">File name</label> <input id="file-name" type="text" value="my-snippet" class="cui-field-input cui-textfield-input" data-cui="textfield-input" data-size="sm" data-variant="filled" /> <div class="cui-field-description" data-cui="textfield-description">Used as the name of the PNG.</div> </div> <div class="cui-stack" data-direction="row" data-gap="2" data-justify="end"> <button type="button" class="cui-button" data-cui="button" data-variant="secondary">Cancel</button> <button type="submit" class="cui-button" data-cui="button" data-variant="primary">Export PNG</button> </div></form>The form above is plain HTML. Every demo in this section renders in a sandboxed frame that loads @codeui/styles/all.css and blocks scripts. What you see is the stylesheet alone.
What the CSS does
- Draws every component of the kit: the same tokens, sizes, density, and motion.
- Reads appearance from attributes such as
data-variant="primary"anddata-size="md". - Reads state from attributes such as
data-checked,data-invalid, anddata-expanded, plus native pseudo-classes such as:focus-visible. - Switches light and dark with
data-cui-themeon any container.
What the CSS does not do
CSS styles state. It does not create it. A static page shows a menu open or a tab selected because the markup says so. A working page needs code that:
- Handles events, keyboard navigation, and focus.
- Sets accessible names, roles, and ARIA state.
- Toggles the
data-*state attributes the CSS reads. - Positions overlays and writes geometry variables such as
--cui-progress-fill-width.
Native controls carry much of this for free: a button, an input type="checkbox", or a table needs no script. Composite widgets such as Select, Tabs, Dialog, or Command menu need behavior. Write it yourself, use a headless library, or use the Solid components in @codeui/solid.
When to use it
| You build with | Use |
|---|---|
| Solid | @codeui/solid. It loads this CSS and supplies the behavior. |
| Static HTML, a server template, or a CMS | @codeui/styles and the markup on these pages. |
| React, Vue, Svelte, Angular, or Web Components | @codeui/styles plus your own or a headless behavior layer. The StyleProps helpers return the attributes to spread. |
In this section
- Installation loads the CSS with or without a bundler.
- Markup explains classes, part markers, and variant attributes.
- States lists the attributes a behavior layer sets.
- Theming covers light and dark, tokens, density, and cascade layers.
- Playground lets you edit any demo live.
- The component pages show the markup for each part, with demos.