Bestax: Optimize CSS
БесплатноБез исполняемых скриптовНе проверен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…
от allxsmith360 установок в других каталогахОб этом скилле
Optimizing CSS size with @allxsmith/bestax-bulma
The JS side is tree-shakable (the entire library is ~49 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 - 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*). Any hit → do not use no-helpers; fall back to
no-dark-mode or Lever 2. The bestax extras helpers (is-cursor-*, sizing) are dropped too.
Lever 2 — modular Sass build
Compile only the Bulma modules + bestax extras partials the app actually uses. Needs the
sass compiler as a dev dependency (Bulma's own build tool — Vite compiles .scss natively):
npm install -D sass
Create 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/navbar';
// …and per bestax extras component:
@use '@allxsmith/bestax-bulma/scss/components/dialog';
// 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';,
Установить Bestax: Optimize CSS в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Bestax: Optimize CSS?
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.
Как установить скилл Bestax: Optimize CSS?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Bestax: Optimize CSS запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic