PolyFish — a modular HTML and CSS framework. Twelve modules, loaded individually, no build step, no required JavaScript.
  • CSS 41.4%
  • HTML 32.8%
  • Python 17.8%
  • JavaScript 7.9%
Find a file
2026-11-30 00:01:02 +00:00
.github PolyFish 0.22.0 — import from polyfish.org production webroot 2026-11-13 04:36:23 +00:00
.well-known PolyFish 0.22.0 — import from polyfish.org production webroot 2026-11-13 04:36:23 +00:00
art PolyFish 0.22.0 — import from polyfish.org production webroot 2026-11-13 04:36:23 +00:00
articles PolyFish 0.25.0 — region-namespaced class grammar 2026-11-16 05:19:59 +00:00
blog v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
docs v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
examples v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
fonts PolyFish 0.24.0 — SudoSecurity palette, Geist faces, CSP headers 2026-11-16 05:07:36 +00:00
nginx PolyFish 0.22.0 — import from polyfish.org production webroot 2026-11-13 04:36:23 +00:00
showcase/thumbs PolyFish 0.22.0 — import from polyfish.org production webroot 2026-11-13 04:36:23 +00:00
starters v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
tests Drop __element from the class grammar 2026-11-16 06:12:32 +00:00
themes Drop __element from the class grammar 2026-11-16 06:12:32 +00:00
tools v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
.gitignore Ignore npm pack output 2026-11-16 05:07:38 +00:00
.npmignore PolyFish 0.22.0 — import from polyfish.org production webroot 2026-11-13 04:36:23 +00:00
404.html v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
about.html v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
apple-touch-icon.png PolyFish 0.22.0 — import from polyfish.org production webroot 2026-11-13 04:36:23 +00:00
changelog.html v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
CHANGELOG.md v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
changelog.xml v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
CONTRIBUTING.md Drop __element from the class grammar 2026-11-16 06:12:32 +00:00
docs-search.json v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
favicon.ico PolyFish 0.22.0 — import from polyfish.org production webroot 2026-11-13 04:36:23 +00:00
index.html v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
LICENSE PolyFish 0.22.0 — import from polyfish.org production webroot 2026-11-13 04:36:23 +00:00
llms-full.txt v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
llms.txt PolyFish 0.22.0 — import from polyfish.org production webroot 2026-11-13 04:36:23 +00:00
offline.html v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
og-cover.png PolyFish 0.22.0 — import from polyfish.org production webroot 2026-11-13 04:36:23 +00:00
opensearch.xml PolyFish 0.22.0 — import from polyfish.org production webroot 2026-11-13 04:36:23 +00:00
package-lock.json PolyFish 0.24.0 — SudoSecurity palette, Geist faces, CSP headers 2026-11-16 05:07:36 +00:00
package.json v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
page-changelog.css Drop __element from the class grammar 2026-11-16 06:12:32 +00:00
page-changelog.min.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
page-components.css Drop __element from the class grammar 2026-11-16 06:12:32 +00:00
page-components.min.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
page-examples.css Drop __element from the class grammar 2026-11-16 06:12:32 +00:00
page-examples.min.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
page-icons.css Drop __element from the class grammar 2026-11-16 06:12:32 +00:00
page-icons.min.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
page-install.css Drop __element from the class grammar 2026-11-16 06:12:32 +00:00
page-install.min.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
page-layout.css Drop __element from the class grammar 2026-11-16 06:12:32 +00:00
page-layout.min.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
page-playground.css Drop __element from the class grammar 2026-11-16 06:12:32 +00:00
page-playground.min.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
page-reference.css Drop __element from the class grammar 2026-11-16 06:12:32 +00:00
page-reference.min.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
page-theming.css Drop __element from the class grammar 2026-11-16 06:12:32 +00:00
page-theming.min.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
page-typography.css Drop __element from the class grammar 2026-11-16 06:12:32 +00:00
page-typography.min.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
playwright.config.js PolyFish 0.22.0 — import from polyfish.org production webroot 2026-11-13 04:36:23 +00:00
polyfish-logo-navy.png PolyFish 0.22.0 — import from polyfish.org production webroot 2026-11-13 04:36:23 +00:00
polyfish-logo-navy.svg PolyFish 0.22.0 — import from polyfish.org production webroot 2026-11-13 04:36:23 +00:00
polyfish-logo.png PolyFish 0.22.0 — import from polyfish.org production webroot 2026-11-13 04:36:23 +00:00
polyfish-logo.svg PolyFish 0.22.0 — import from polyfish.org production webroot 2026-11-13 04:36:23 +00:00
polyfish-mark.png PolyFish 0.22.0 — import from polyfish.org production webroot 2026-11-13 04:36:23 +00:00
polyfish-mark.svg PolyFish 0.22.0 — import from polyfish.org production webroot 2026-11-13 04:36:23 +00:00
polyfish.d.ts PolyFish 0.25.0 — region-namespaced class grammar 2026-11-16 05:19:59 +00:00
polyfish.js v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
polyfish.min.js v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
polyfish.mjs v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
polyfishcss-0.22.0.tgz PolyFish 0.25.0 — region-namespaced class grammar 2026-11-16 05:19:59 +00:00
polyfishcss-0.24.0.tgz PolyFish 0.25.0 — region-namespaced class grammar 2026-11-16 05:19:59 +00:00
polyfishcss-0.25.0.tgz PolyFish 0.25.0 — region-namespaced class grammar 2026-11-16 05:19:59 +00:00
polyfishcss-1.0.0-beta.2.tgz PolyFish 1.0.0-beta.2 — API freeze candidate 2026-11-16 05:48:29 +00:00
polyfishcss-1.0.0-beta.3.tgz Drop __element from the class grammar 2026-11-16 06:12:32 +00:00
polyfishcss-1.0.0-beta.4.tgz v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS-Classless.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS-Classless.min.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS-Components.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS-Components.min.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS-Content.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS-Content.min.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS-Core.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS-Core.min.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS-Effects.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS-Effects.min.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS-Fonts.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS-Fonts.min.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS-Footers.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS-Footers.min.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS-Forms.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS-Forms.min.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS-Headers.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS-Headers.min.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS-Space.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS-Space.min.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS-Utilities.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS-Utilities.min.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS-Variants.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS-Variants.min.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
PolyFishCSS.min.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
README.md Drop __element from the class grammar 2026-11-16 06:12:32 +00:00
robots.txt PolyFish 0.22.0 — import from polyfish.org production webroot 2026-11-13 04:36:23 +00:00
showcase.html v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
site.css Drop __element from the class grammar 2026-11-16 06:12:32 +00:00
site.js Drop __element from the class grammar 2026-11-16 06:12:32 +00:00
site.min.css v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
site.webmanifest PolyFish 0.22.0 — import from polyfish.org production webroot 2026-11-13 04:36:23 +00:00
sitemap.xml PolyFish 0.22.0 — import from polyfish.org production webroot 2026-11-13 04:36:23 +00:00
sw.js v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00
TESTING.md PolyFish 0.22.0 — import from polyfish.org production webroot 2026-11-13 04:36:23 +00:00
VERSION v1.0.0-beta.4: terminal component, eyebrow prompt variant, status tokens 2026-11-30 00:01:02 +00:00

PolyFish

A modular HTML and CSS framework. Nine core files you load individually, four optional ones, no build step, and no JavaScript required to render anything.

<!-- required -->
<link rel="stylesheet" href="PolyFishCSS-Core.min.css">

<!-- whatever the page actually contains -->
<link rel="stylesheet" href="PolyFishCSS-Headers.min.css">
<link rel="stylesheet" href="PolyFishCSS-Content.min.css">
<link rel="stylesheet" href="PolyFishCSS-Footers.min.css">

A marketing page loads four files, about 10 KB over the wire. The whole framework is 18 KB gzipped. Documentation and live examples: https://polyfish.org

Install

npm install polyfishcss

Or copy the files. There is nothing to compile, and nothing to configure. Every module is its own subpath, so a bundler includes only what you import:

import "polyfishcss";            // the whole bundle — or "polyfishcss/core", "polyfishcss/content", …
import { init, toast } from "polyfishcss/js";   // optional script: ESM, typed, SSR-safe

From a CDN, pin the version and use the published integrity hash:

<link rel="stylesheet"
      href="https://cdn.jsdelivr.net/npm/polyfishcss@0.22.0/PolyFishCSS.min.css"
      integrity="sha384-CxTfYKg2TZShCM38hym6r7gKjWioxodnYapoG6Zk3dGlw7DtY2GZaQliMYYDfmuj"
      crossorigin="anonymous">

Generate the hash for any release with:

openssl dgst -sha384 -binary PolyFishCSS.min.css | openssl base64 -A

Source & releases

The canonical repository is https://git.sudosecurity.org/sudosecurity/PolyFish (public, MIT). Tagged releases attach a zip and tarball of the full dist, the npm pack tarball and SHA256SUMS: https://git.sudosecurity.org/sudosecurity/PolyFish/releases

The modules

File What it covers Minified
Core Tokens, reset, type scale, intrinsic layout primitives, density, buttons, focus 15 KB
Headers Announcement bar, navigation, heroes, page heads 7 KB
Content Sections, cards, plans, stats, tables, alerts, code, accordions 14 KB
Forms Floating labels, validation, fieldsets, range, file inputs 5 KB
Components Badges, tabs, menus, dialogs, pagination, lists, toasts 15 KB
Footers Column, slim and accent footers 4 KB
Space Gap, top and bottom margins, padding, proportional widths, flex sizing 2 KB
Effects Transitions, frosted glass, rings, gradients, animations 7 KB
Utilities Display, sizing, position, typography, colour helpers 7 KB
Fonts Self-hosted @font-face declarations 3 KB
Classless Styles bare semantic elements, no classes needed 4 KB
Variants Curated state variants: hover, focus, active, group 2 KB

Past eight modules, ship PolyFishCSS.min.css instead — it is smaller gzipped than the same modules fetched separately, in one request.

Principles

  • Nothing requires JavaScript. The mobile menu is a checkbox, tabs are radio inputs, the accordion is <details>. polyfish.js is optional and upgrades what already works; it never creates behaviour that only exists when a script runs, and it hides nothing on load.
  • Components read roles, never palette values. Hover, wash, border and focus colours derive from the accent, so a theme can be one declaration. The checker fails the build if a component reads the palette directly.
  • Tokens name position, not hue. --pf-base-800, --pf-hue-1. A token called --pf-blue-800 is correct in one palette and lying in every other.
  • Data gets utility classes, not inline styles, so a strict Content-Security-Policy never needs unsafe-inline to draw a progress bar.
  • Reduced motion is honoured everywhere. Under prefers-reduced-motion: reduce, Core collapses every transition and animation to effectively zero — completing it rather than slowing it, because slowing an animation that starts at opacity: 0 leaves the element invisible.
  • Your CSS wins. Every module is in a cascade layer, so unlayered author styles override any framework rule with a plain class selector — no !important, and no dependence on load order.
  • Prints properly. A black-on-white palette, chrome dropped, hidden panels opened, link addresses printed, and page-break rules so a table is not split across two sheets.
  • No physical directions. Margins, padding, borders, offsets and alignment are all logical, so dir="rtl" mirrors the layout with no second stylesheet. A build check fails if a margin-left reappears.

Native dialogs and menus

<button type="button" commandfor="confirm" command="show-modal">Delete</button>
<dialog class="pf-comp-dialog" id="confirm" closedby="any">
  <p>Delete this?</p>
  <button type="button" commandfor="confirm" command="close">Cancel</button>
</dialog>

no JavaScript for modals, menus or tooltips: the popover attribute and invoker commands are Baseline across every engine, and the framework styles them with animated enter and exit.

State variants, no build step

<a class="pf-content-card pf-fx-hover-lift pf-fx-hover-shadow-lg pf-fx-focus-ring" href="/post">
<button class="pf-ctrl-btn pf-fx-active-sink">Save</button>
<p class="pf-dark-hidden">Only in the light theme</p>

PolyFishCSS-Variants.css is optional and loads after Utilities. It covers nine states across twenty-six utilities using the same infix convention as the responsive variants (pf-md-hidden). Coming from Tailwind: see the translation table on the installation page.

Theming

:root {
  --pf-bg: #0d1117;
  --pf-text: #e6edf3;
  --pf-accent: #7dd3fc;
  --pf-ink: #04121f;
}

Or just the accent — hover, washes, borders and focus rings are derived from it with color-mix():

:root { --pf-accent: #d9734e; }

To retint one region instead, put .pf-theme-retint on the element that sets the new accent. Six example themes ship in themes/. Light mode follows prefers-color-scheme and can be pinned with data-pf-theme on <html>.

Layout without breakpoints

.pf-ctrl-switcher, .pf-page-sidebar, .pf-space-cover, .pf-center and .pf-page-imposter respond to the width of their container, not the window, so the same markup works in a sidebar and in a full-width band. One knob, --pf-density, scales every space step, gap and section; .pf-theme-compact and .pf-theme-airy apply it to a region.

<div class="pf-page-sidebar">
  <nav class="pf-page-sidebar-side">…</nav>
  <main class="pf-page-sidebar-main">…</main>
</div>

Status

0.19.0 — pre-1.0. The API is close to settled, but a minor release may still rename a class or token. Every rename and removal is listed with its replacement in the migration guide. 0.20 removed the Compat aliases file along with the classes listed there.

1.0 waits on verification rather than features. The browser suite in tests/ passes on Chromium desktop and Android Chrome with baselines committed; it still has to run green on Firefox, WebKit and iPhone. After that: a screen-reader pass and a Lighthouse run.

Browser support

Chrome 105, Safari 15.4, Firefox 103 and newer. Later features (:has(), @container, animation-timeline, color-mix()) sit behind @supports or have a declared fallback, so older engines do less rather than breaking.

Development

pip install tinycss2 rcssmin
npm install

python3 tools/verify.py        # 13 groups of static checks, exits non-zero on failure
npm run validate            # current Nu validator (needs Java)
node tools/test-polyfish.cjs    # jsdom behaviour tests for the optional script
npx playwright test            # three engines, three widths, screenshot baselines

First run, setup and what to send back: see TESTING.md.

python3 tools/release.py 0.17.0

tools/release.py is the only thing that writes a version number. It stamps the sources, rebuilds the minified files and the bundle, rewrites every asset URL with a content hash, refreshes the integrity hash, regenerates CHANGELOG.md, and refuses to finish if verification fails.

Licence

MIT — see LICENSE. The bundled fonts are SIL Open Font License 1.1 and carry their own licence texts in fonts/; ship those with the woff2 files.