Alloy CSS, Tested: Dialogs, Menus and Tabs With JavaScript Off

Most "no-JavaScript" CSS kits quietly need a script for the interesting parts. Alloy CSS claims the opposite: one stylesheet for HTML your server renders, with dialogs, menus, drawers, tabs, tooltips and toasts that work with scripts turned off — no build step, no framework. It hit Hacker News on November 17, 2026 (208 points) and a half-dozen write-ups followed in a week. We installed v1.0.14 from npm, built our own test page with zero <script> tags, and drove it in Chrome with JavaScript disabled — clicking, pressing Esc, tabbing with arrow keys — to find out which parts of the claim survive contact with a real browser. Every result below is from that run, including the two places the claim bends and the one we could not verify in a headless browser.

1. What Alloy CSS is

Alloy CSS (alloyhtml/css on GitHub, by Fandy Pradana) is a single stylesheet for server-rendered HTML: utilities (spacing, sizes, breakpoints) plus the interactive parts you would normally pull in a JavaScript library for — dialogs, menus, drawers, tabs, tooltips and toasts — built on native browser features (<dialog>, popover, radio buttons, <details>, scroll-snap) instead of script. The kit holds the structure; your taste (colours, fonts, corner radius) goes in one small brand file of your own. It fits Rails, Django, Laravel, htmx or a folder of plain HTML files, and it is plain CSS, so it also works inside React, Vue or Svelte — the interactive parts just do not need their JavaScript.

Version testedv1.0.14 (npm, 2026-11-20)
LicenceMIT — free, commercial use OK
Size~24 KB gzipped (minified)
GitHub83 stars · 4 forks (2026-11-25)
Cost / account$0 · none needed
Date tested2026-11-25

Attribution: Alloy CSS is by Fandy Pradana (alloyhtml/css), MIT licence. This tutorial is based on our own hands-on test — the test page, the browser runs and the findings are ours; the kit's docs are quoted only where we say so.

2. Install — the two lines we actually used

From a CDN, one link tag:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@alloyhtml/css@1/dist/alloy.min.css">

Or from npm, which is what we did (package @alloyhtml/css, installed 2026-11-25, version 1.0.14, licence confirmed MIT in the package's own LICENSE file):

npm install @alloyhtml/css

Then link node_modules/@alloyhtml/css/dist/alloy.min.css. That is the whole install — there is no build step, no config file and nothing to compile. Dark themes ship in the same package under dist/themes/ (dark, a soft graphite, and midnight, a soft navy); the brand file is a second, small stylesheet you write yourself and link after the kit.

Honesty box — what we did and did not run. We installed from npm, read the README and the bundled skill reference, and tested our own page in headless Chrome (Google Chrome for Testing 156). We did not test on an older browser (none exists on this machine) — browser-floor claims in section 5 are labelled docs-sourced, not tested. We also did not buy or test the project's separately-sold page templates; the CSS kit itself is free and that is all this tutorial covers.

3. Our test: a zero-script page, driven with JavaScript off

We built one test page with zero <script> tags — a modal dialog, a menu, a drawer, a three-tab set, two accordion rows, a scroll-snap carousel, a tooltip, a toast, a copy button and a small form — all marked up exactly as the kit's docs and bundled example show. Then we drove it in Chrome with script execution disabled: real mouse clicks, Esc, click-outside, arrow keys and Tab. Here is the scoreboard.

ComponentResultWhat we observed
DialogPassOpens on click (commandfor + command="show-modal"), closes on Esc, on click outside (closedby="any") and on its close button. While open, the page stops scrolling (html overflow-x: hidden); it returns to normal after close.
Menu (popover)PassOpens on click, closes on a click elsewhere in the page.
Drawer (popover)PassAt an 800px viewport it opens as a fixed overlay, closes on Esc, and the trigger button toggles it (verified with keyboard Space on the focused trigger). At 1280px it is not a popover at all — it renders as a permanent static sidebar, by design (@media (min-width: 993px)). Test your drawer at phone width, not desktop width.
TabsPassThey are radio buttons: clicking a tab switches the panel, and the arrow keys move between tabs (Right arrow moved us from Reviews to Shipping, panel included). Keyboard support comes free with the native control.
AccordionPassPlain <details> rows; with the same name on both, opening the second closes the first.
CarouselPassPure CSS scroll-snap: a wheel scroll moved the row (third card's x-position 608 → 344) and it settles on an item.
TooltipPartialVerified through keyboard focus: the tip appeared after 8 Tabs (:focus-visible rule). The hover path we could not verify in this environment — headless Chrome reports matchMedia('(hover: hover)') === false, so the @media (hover: hover) rule never activates here. The rule is present in the stylesheet; confirm hover on a real desktop browser.
ToastPass*Stays hidden with JavaScript off. Showing it needs one line of script — showPopover() — and its close button needs none. The asterisk is the point: "no JavaScript" has exactly one exception here, and the docs say so.
Copy buttonPass*With JavaScript off, clicking does nothing. The kit ships no copy code at all — only data-copy attributes. Your own one-liner (navigator.clipboard.writeText(...) plus the label swap) works: the write succeeded and the label flipped to "Copied". (Clipboard read-back was blocked by a headless permission, so the pasted text itself was not re-read here.)
Form fieldsPassInputs, selects and textareas render at the kit's 40px control height with its borders and focus ring.

The two one-liners, exactly. Toast: document.getElementById('toast-id').showPopover(). Copy button: navigator.clipboard.writeText(document.querySelector('#source').textContent), plus toggling the data-copy-idle / data-copy-done labels. That is the entire JavaScript surface of the kit on a page — two lines, both yours, both optional.

4. Dark theme, brand tokens and the CLI checker

Dark theme + brand file: one catch

Our brand file overrode --brand-primary-1 to orange and --control-radius to 999px. In light mode it worked first try — the Save button measured rgb(218, 98, 11) (orange, not the default violet) with pill corners. In dark mode it failed at first: the button stayed violet. The cause is in the dark theme file itself — it reads --brand-dark-primary-1, not the light token. A complete brand file must set both sets:

:root {
  --brand-primary-1: hsl(25, 90%, 45%);       /* light mode */
  --brand-dark-primary-1: hsl(25, 90%, 55%);  /* dark mode */
  --brand-dark-primary-2: hsl(25, 90%, 62%);
  --brand-dark-primary-3: hsl(25, 90%, 70%);
  --control-radius: 999px;
}

With both sets in place, dark mode passed too — graphite page (rgb(36, 36, 39)), orange button (rgb(244, 123, 37)). Link the dark theme with media="(prefers-color-scheme: dark)" and the switch follows the visitor's device with zero script.

Class conflicts: last stylesheet wins

Alloy's .button sets background-color: transparent. We defined our own .button { background-color: #ff0000; } in both link orders: our file linked after the kit won (red), linked before it lost (transparent). That is the documented rule — "where both define one, the stylesheet linked last wins" — and it applies to every shared name the README lists (.dialog, .field, .flex, .hidden, .tab, .tooltip, .text-center, the fade-in / slide-in-up / zoom-in animations, and --color-* / --font-* variables). We ran the .button case live; the rest follow the same cascade rule. Adding the kit to an existing site also restyles the page before you use a single class — the reset removes body/heading margins, links lose their underline (add .a to get it back), and h1 becomes 40px. Budget a pass for that.

The CLI checker actually catches typos

npx @alloyhtml/css check templates/ lists every class the kit does not define, with file and line, and exits 1 when it finds one. We fed it a template with three invented classes — mt-4, btn-primary, bg-fake-99 — and it flagged all three exactly (templates/bad.html:5/6/7). Fixing them to kit classes returned exit 0. One honest caveat: it also flags other libraries' classes — a template with Bootstrap-style .container and .my-widget failed the check too. The escape hatches are --css your.css (register your own stylesheet's classes) and --allow name (skip a class, e.g. an icon font). Both verified: --allow container,my-widget returned exit 0.

5. The limits, stated plainly

6. FAQ

Does it really work with JavaScript fully off — dialog, menu, drawer, tabs, accordion, carousel, tooltip, toast, one by one?

Yes, except for two. We ran all of them with scripts disabled in Chrome 156: dialog (open, Esc, click-outside, close button), menu, drawer (at phone width), tabs (click and arrow keys), accordion, carousel (wheel scroll and snap), tooltip (via keyboard focus — hover itself unverified in headless, see section 5), and form fields all worked. Toast stays hidden until one line of script shows it; the copy button does nothing at all without your own one-liner. Those are the only two exceptions, and the docs disclose both.

Is it accessible — keyboard-only use, focus, Esc, arrow keys between tabs?

What we verified: tabs are native radio buttons, so arrow keys move between them and the panel follows; dialogs close on Esc; the drawer closes on Esc; tooltips appear on keyboard focus; the kit styles :focus-visible. What we did not verify: no screen reader was available on this machine, so we make no screen-reader claim. The components are built on native elements (<dialog>, popover, radio buttons, <details>), which is the right foundation — but a screen-reader pass is still an open item before you call a page accessible.

What breaks when adding it to an existing site?

Two things. First, the reset applies before you use a single class: body/heading/paragraph/list margins go, sizing becomes border-box everywhere, h1 becomes 40px, links lose their underline and take the surrounding text colour (add .a to make a link look like one), and the page uses the light colour scheme. Second, class-name collisions: .button, .dialog, .field, .flex, .hidden, .tab, .tooltip and .text-center are common names, and the stylesheet linked last wins — we proved it live with .button in both orders. Link your own stylesheet after the kit if your definitions should win, and run alloy-check with --css so your classes are registered.

Which browsers exactly — and what does a visitor on an older browser see?

Docs-sourced, not tested here. The kit floor is Chrome/Edge 123, Firefox 125, Safari 17.5 (popover, :has(), color-mix(), light-dark()). Dialogs need more: command/commandfor arrive in Chrome/Edge 135, Firefox 144, Safari 26.2 — on anything older, the button that opens a dialog does nothing at all (no error, no fallback). Click-outside close needs Safari 27.3; Esc and the close button work everywhere. Below the kit floor, the layout utilities degrade unevenly — treat the documented floors as your support policy, not a suggestion.

Does the CLI checker catch invented classes and typos — and does it false-positive on other libraries' classes?

Yes to both, verified. It flagged all three invented classes in our bad template with file and line, exited 1, and returned exit 0 after we fixed them. It also flagged Bootstrap-style .container and .my-widget — so on a mixed codebase it will false-positive until you register your own classes with --css your.css or skip names with --allow. Use it in CI with your stylesheet registered, not bare.

Do dark themes and brand tokens really work — one small file, light and dark?

Yes, with one catch we hit live. One brand file re-skinned our button orange with pill corners in light mode on the first try. Dark mode stayed violet until we also set the --brand-dark-primary-1/2/3 tokens — the dark theme reads those, not the light ones. With both token sets, the button stayed orange in dark mode too, and the prefers-color-scheme switch needed zero script. Copy the full token list from the kit's Themes & Brands docs, not just the light half.

Want a website built this way — tested, not just claimed?

This tutorial exists because we run these checks on our own site first. That is the same habit we bring to client work. Our website services build bilingual (English/French) sites for small businesses from C$699 — hand-checked code, modern patterns, and a free preview before you pay. Already have a site? Start with our free tools, or ask us for a modernisation pass: we will test it, show you what actually works, and fix what matters.

Want it printed?

We can put your design on T-shirts, hoodies, mugs, posters and more — printed to order in Quebec, no minimums, with a free preview before you pay.

Contact us for a free quote