bestax-optimize
Skill3 starsChanged todayMITView on GitHub
Reduce the built CSS size of an app using @allxsmith/bestax-bulma — measure raw and gzip size, then apply the cheapest lever that fits (lighter prebuilt CSS flavor, hand-rolled modular Sass build, import and icon-asset hygiene). Use when the CSS bundle looks too big, a size budget or Lighthouse audit flags stylesheet weight, switching bestax.css to a versions/*.css flavor, or setting up a modular @use Bulma/Sass build.
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- allxsmith/bestaxword for word, first seen Oct 9, 2026
Other versions1 project uses a version of this.
Word for word · 1
- allxsmith/bestax★ 14100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- bestax-custom-componentSkill
- bestax-formSkill
- bestax-iconsSkill
- bestax-layout-scaffoldSkill
- bestax-migrateSkill
- bestax-themingSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Run the production build, then measure the built CSS — raw and gzip:
- Very specific: line 92
Create src/styles.scss — base + themes always come first:
- Distinctive: line 132
When the app does render Material Symbols, its font can be made smaller instead of removed: see Making the font smaller.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Optimizing CSS size with @allxsmith/bestax-bulma
The JS side is tree-shakable (the entire library is ~65 KB min+gzip). The stylesheet is
not: a prebuilt flavor ships all of Bulma + the bestax extras regardless of which components
the app renders. Judge stylesheet weight by the gzipped transfer size — never the raw
dist/ number.
Always measure first
Run the production build, then measure the built CSS — raw and gzip:
npm run build
wc -c dist/assets/*.css # raw bytes (what Vite reports)
gzip -c dist/assets/*.css | wc -c # transfer bytes (what users download)Re-measure after every step below and report the before/after delta (raw + gzip). Never claim a saving without a number.
⚠️ ~800 KB raw is ~82 KB over the wire. Seeing ~800 KB of CSS in dist/ is expected
with the default flavor, not a build misconfiguration — servers and CDNs gzip/brotli by
default. If the gzip number is already within the app's budget, say so and stop: "your CSS is
already fine" is a valid, honest outcome.
Decision flow
Cheapest first. Use only the library's own shipped CSS builds and SCSS sources — do not add third-party build plugins (no CSS purgers/post-processors).
- Flavor switch — one-line import change, minutes (up to ~15 KB gzip).
- Modular Sass build — small
@usefile, the biggest honest win. - Import & icon-asset hygiene — minor; JS and icon fonts, not the Bulma CSS.
Lever 1 — lighter prebuilt flavor
Swap the single CSS import (in src/main.tsx / src/main.jsx) between the shipped flavors.
Measured sizes drift slightly between releases — hence measure:
| Flavor | Import | Raw | Gzip |
| complete | import '@allxsmith/bestax-bulma/bestax.css'; | ~800KB | ~82 KB |
| no-dark-mode | import '@allxsmith/bestax-bulma/versions/bestax-no-dark-mode.css'; | ~680KB | ~70 KB |
| no-helpers | import '@allxsmith/bestax-bulma/versions/bestax-no-helpers.css'; | ~595KB | ~67 KB |
Prefixed variants (versions/bestax-prefixed.css ~875 KB/~84 KB,
versions/bestax-no-helpers-prefixed.css ~655 KB/~69 KB) exist for CSS-collision
compatibility, not size — a prefixed flavor must pair with
<ConfigProvider classPrefix="bestax-"> at the app root, and switching a non-prefixed app to
one is never a size optimization.
no-dark-mode(~12 KB gzip saved) — only when the app pins a single color scheme (a fixedTheme colorMode/data-theme).no-helpers(~15 KB gzip saved) — hard gate below.
⚠️ The no-helpers gate: check for helper props first. That flavor drops every class the
helper props compile to — components still render, but the props silently do nothing. Before
recommending it, grep the app's source for helper props on bestax components:
- spacing:
m,mt,mr,mb,ml,mx,my,p,pt,pr,pb,pl,px,py - gap:
gap,columnGap,rowGap,gapless, on any component,Gridincluded: its gap props render the same helper classes - color:
color,backgroundColor(+colorShade/backgroundColorShade),textColor,bgColor - typography:
textSize,textAlign,textTransform,textWeight,fontFamily - display/visibility:
display,visibility(+displayMobile…visibilityFullhdviewport variants) - flexbox:
flexDirection,flexWrap,justifyContent,alignContent,alignItems,alignSelf,flexGrow,flexShrink - misc:
float,overflow,overflowX,overflowY,overlay,interaction,cursor,radius,shadow,skeleton,clearfix,pos,relative,fullHeight,aspectRatio
…and for raw Bulma helper classes in className strings (is-*, has-*, m*-*, p*-*,
is-size-*, is-hidden*, is-flex*, is-gap-*). Any hit → do not use no-helpers; fall back to
no-dark-mode or Lever 2. The bestax extras helpers (is-cursor-*, sizing, and the breakpoint is-sr-only-* that
visibilityTablet="sr-only" and the like write) are dropped too.
Lever 2 — modular Sass build
Compile only the Bulma modules + bestax extras partials the app actually uses. Needs bulma
as a dependency of the app itself (under pnpm, the app's Sass can only load what the app lists)
and the sass compiler as a dev dependency (Bulma's own build tool — Vite compiles .scss
natively):
# with the project's own package manager (pnpm add, yarn add) if it isn't npm
npm install bulma
npm install -D sassCreate src/styles.scss — base + themes always come first:
// Configure shared variables FIRST (before anything loads utilities) —
// the prebuilt flavors set this brand primary; omit it and buttons revert
// to Bulma's default turquoise:
@use 'bulma/sass/utilities' with (
$primary: #1e6b99
);
// Required base: reset + CSS variable definitions
@use 'bulma/sass/base';
@use 'bulma/sass/themes';
// One line per stock Bulma component the app imports…
@use 'bulma/sass/elements/button';
@use 'bulma/sass/components/card';
// …and per bestax extras component:
@use '@allxsmith/bestax-bulma/scss/components/dialog';
// …and bestax's partial for a stock component that has one:
@use '@allxsmith/bestax-bulma/scss/elements/button' as bestax-button;
// Helper categories only if the app uses those helper props:
@use 'bulma/sass/helpers/spacing';Then replace the prebuilt CSS import in src/main.tsx with import './styles.scss';,
build, and measure. Derive the @use list from the components the app imports from
@allxsmith/bestax-bulma — the full component→partial mapping, the authoritative extras
partial inventory, and a worked example are in references/modular-build.md.
Lever 3 — import & icon-asset hygiene (minor)
- Named imports. Convert
import * as Bestax from '@allxsmith/bestax-bulma'to named imports (import { Button, Card } from …). Any saving is on the JS side, so report it honestly as minor. - Unused icon libraries. Scaffolded apps may carry an icon library the app never uses:
icon-font packages in
package.json(@fortawesome/fontawesome-free,@mdi/font,material-icons,material-symbols) with their CSS imports insrc/main.*, or Ionicons CDN<script>tags inindex.html. Icon fonts often outweigh Bulma itself — if no<Icon>uses that library, delete the dependency/import/script. Pure win, no tooling. When the app does render Material Symbols, its font can be made smaller instead of removed: see Making the font smaller.
References
references/modular-build.md— full Lever 2 procedure: component→partial mapping, the authoritative extras partial inventory, helper categories, and a workedstyles.scss.- Docs: Optimizing CSS Size · Modular — Option C · CSS Variations
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

