- CSS 41.4%
- HTML 32.8%
- Python 17.8%
- JavaScript 7.9%
| .github | ||
| .well-known | ||
| art | ||
| articles | ||
| blog | ||
| docs | ||
| examples | ||
| fonts | ||
| nginx | ||
| showcase/thumbs | ||
| starters | ||
| tests | ||
| themes | ||
| tools | ||
| .gitignore | ||
| .npmignore | ||
| 404.html | ||
| about.html | ||
| apple-touch-icon.png | ||
| changelog.html | ||
| CHANGELOG.md | ||
| changelog.xml | ||
| CONTRIBUTING.md | ||
| docs-search.json | ||
| favicon.ico | ||
| index.html | ||
| LICENSE | ||
| llms-full.txt | ||
| llms.txt | ||
| offline.html | ||
| og-cover.png | ||
| opensearch.xml | ||
| package-lock.json | ||
| package.json | ||
| page-changelog.css | ||
| page-changelog.min.css | ||
| page-components.css | ||
| page-components.min.css | ||
| page-examples.css | ||
| page-examples.min.css | ||
| page-icons.css | ||
| page-icons.min.css | ||
| page-install.css | ||
| page-install.min.css | ||
| page-layout.css | ||
| page-layout.min.css | ||
| page-playground.css | ||
| page-playground.min.css | ||
| page-reference.css | ||
| page-reference.min.css | ||
| page-theming.css | ||
| page-theming.min.css | ||
| page-typography.css | ||
| page-typography.min.css | ||
| playwright.config.js | ||
| polyfish-logo-navy.png | ||
| polyfish-logo-navy.svg | ||
| polyfish-logo.png | ||
| polyfish-logo.svg | ||
| polyfish-mark.png | ||
| polyfish-mark.svg | ||
| polyfish.d.ts | ||
| polyfish.js | ||
| polyfish.min.js | ||
| polyfish.mjs | ||
| polyfishcss-0.22.0.tgz | ||
| polyfishcss-0.24.0.tgz | ||
| polyfishcss-0.25.0.tgz | ||
| polyfishcss-1.0.0-beta.2.tgz | ||
| polyfishcss-1.0.0-beta.3.tgz | ||
| polyfishcss-1.0.0-beta.4.tgz | ||
| PolyFishCSS-Classless.css | ||
| PolyFishCSS-Classless.min.css | ||
| PolyFishCSS-Components.css | ||
| PolyFishCSS-Components.min.css | ||
| PolyFishCSS-Content.css | ||
| PolyFishCSS-Content.min.css | ||
| PolyFishCSS-Core.css | ||
| PolyFishCSS-Core.min.css | ||
| PolyFishCSS-Effects.css | ||
| PolyFishCSS-Effects.min.css | ||
| PolyFishCSS-Fonts.css | ||
| PolyFishCSS-Fonts.min.css | ||
| PolyFishCSS-Footers.css | ||
| PolyFishCSS-Footers.min.css | ||
| PolyFishCSS-Forms.css | ||
| PolyFishCSS-Forms.min.css | ||
| PolyFishCSS-Headers.css | ||
| PolyFishCSS-Headers.min.css | ||
| PolyFishCSS-Space.css | ||
| PolyFishCSS-Space.min.css | ||
| PolyFishCSS-Utilities.css | ||
| PolyFishCSS-Utilities.min.css | ||
| PolyFishCSS-Variants.css | ||
| PolyFishCSS-Variants.min.css | ||
| PolyFishCSS.css | ||
| PolyFishCSS.min.css | ||
| README.md | ||
| robots.txt | ||
| showcase.html | ||
| site.css | ||
| site.js | ||
| site.min.css | ||
| site.webmanifest | ||
| sitemap.xml | ||
| sw.js | ||
| TESTING.md | ||
| VERSION | ||
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.jsis 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-800is 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-inlineto 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 atopacity: 0leaves 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 amargin-leftreappears.
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.