Base16 color themes and uBlock Origin filter rules for websites, delivered as a Firefox userContent.css and a combined rules file.
Per-site CSS files in styles/ remap each site's CSS variables to a shared base16 palette defined in palette.json. A build step wraps them in @-moz-document rules, adds !important to all declarations, and outputs a single userContent.css for Firefox.
The flake exports lib.<system>.mkUserStyles and lib.<system>.uBlockRules:
# In your flake:
usercss.url = "github:knoopx/userContent.css";
# Build userContent.css with your palette:
usercss.lib.${system}.mkUserStyles {
base00 = "#1d2021";
base01 = "#3c3836";
# ...
}
# Combined uBlock Origin rules:
usercss.lib.${system}.uBlockRulespalette.json defines 16 colors (--base00 through --base0F). All site styles reference these variables — change the palette to retheme every site at once.
Each file in styles/ is named <domain>.css and targets :root. Rules:
- Use only
var(--base00)throughvar(--base0F). No hardcoded colors. - No theme-specific selectors (
.dark,.night, etc.). - Use
color-mix(in srgb, var(--baseXX) <percent>%, transparent)for transparency. !importantis added automatically at build time.
rules/ contains per-site uBlock Origin filter rules for JS scriptlets and advanced filtering that CSS cannot handle. Trivial element hiding belongs in styles/ as display: none rules.
Requires pi. From the project directory:
- Run
pito start the agent - Ask it to style a website, e.g. "style github.com"
- Pi will launch Firefox, navigate to the site, extract its CSS variables, create
styles/<domain>.cssmapping them to the palette, inject it for live preview, and take a screenshot - Review the screenshot and ask for adjustments ("make the sidebar darker", "fix the link colors")
- Pi re-edits the CSS, re-injects, and screenshots again
- Repeat until satisfied
Install dependencies:
npm install![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
- postcss — CSS processing
















