Stylesheets: pre-1 Bulma → Bulma v1 + bestax
Every library bestax-migrate migrates from is pinned to a pre-1 Bulma: react-bulma-components
to 0.9.x, rbx to 0.7.5, and a bloomer app to whichever 0.6 it installed itself. bestax-bulma
targets Bulma v1. The codemod automates most of that
stylesheet layer; this reference explains what it did and how to finish what it flagged.
Coming from rbx or bloomer you are crossing two Bulma majors rather than one, so expect more visual drift than the 0.9 → 1 notes below describe on their own.
An app that writes Bulma's classes directly (bulma-classes) keeps its stylesheet by
default: that source runs as --css keep, because the app's own Bulma already styles every
class a converted element renders, so its stylesheet imports, Sass and Bulma version stay as
they were. Moving to Bulma v1 is a separate step, taken with --css bestax or --css bulma.
From a 0.9.x it then follows these notes as written; on Bulma v1 already, only the bundle
choice below applies.
What the codemod already did (--css bestax, the library sources' default)
CSS imports:
bulma/css/bulma(.min).cssand v3-era the source library's own CSS imports (react-bulma-components/dist/*.css,rbx/index.css) became the recommended combined bundle@allxsmith/bestax-bulma/bestax.css(Bulma v1 + the bestax extras that themed Radio/Checkbox and the advanced form controls need). A separateextras.cssimport next to it is collapsed. Visual note:bestax.cssships with$primaryset to bestax blue (#1e6b99), not Bulma's stock turquoise —is-primarysurfaces (hero, navbar, buttons) change color. Keep the stock Bulma look with--css bulma, or set your own brand color via--bulma-primary-*CSS variables / a Sass build. With the variables, set--bulma-primary-invert-land--bulma-primary-on-scheme-lalong with--bulma-primary-h,--bulma-primary-sand--bulma-primary-l. The first is the lightness of the label on a primary surface and the second of primary text on the page, and bestax's build fixes both for its dark blue, so a light primary set through the trio alone keeps white labels and pale text. To get stock Bulma's turquoise back on top ofbestax.css, copy those five from Bulma's ownbulma/css/bulma.css. The on-scheme lightness differs between its light and dark schemes, so set each scheme's value where the app shows both; thebestax-themingskill'sreferences/css-variables.md("The lightnesses Bulma's build picks for contrast") shows how, and what reads each one. Text the page colors withhas-text-primaryconverts totextColor="primary", which reads the trio's own lightness on the light scheme, under 2:1 on white for turquoise (in stock Bulma too); addcolorShade="on-scheme"to take the shade made for text.SCSS files: Bulma 0.9's
@import 'bulma/bulma.sass'(plus preceding$var: value !default;overrides) became Bulma v1 module syntax, with simple literal overrides folded in:@use 'bulma/sass' with ( $primary: #ff6b35, $family-primary: ( 'Nunito', sans-serif, ) ); @use '@allxsmith/bestax-bulma/scss/extras';A comma-valued override (a font-family stack) is wrapped in parens so Dart Sass reads it as one list value, not extra arguments to
with (…).0.9
_allaggregator imports (bulma/sass/elements/_all) became directory modules (@use 'bulma/sass/elements';). Relative node_modules paths (@import '../../node_modules/bulma/bulma', common under Parcel) keep their prefix, and the extras@usethen points at the shipped file (…/node_modules/@allxsmith/bestax-bulma/src/scss/extras) since such toolchains resolve raw paths, not package specifiers. Building Bulma v1 from Sass needs dart-sass ≥ 1.79 — the codemod's node-sass replacement installs that, but check bundler-pinned older versions (Parcel's sass transformer pins 1.66).the source library's own stylesheet — any
react-bulma-components/…orrbx/…specifier, bare,~-prefixed, or a relativenode_modules/path, covering the documented v3 entry points (src/index.sass,dist/react-bulma-components(.min).css,rbx/rbx) as well as deep partials and extensionless forms — is not a third-party extension; it's the library being migrated away from. It targets Bulma 0.9, not the v1 your components now use, and (unless--no-depsis passed)package.jsonno longer lists it, so the import can never resolve once installed. Every--cssmode rewrites it into a real Bulma root rather than leaving a known-broken import — the same shape the@import 'bulma/…'root path emits, so a file that starts from RBC and one that starts from a Bulma import converge:bestax(default) emits@use 'bulma/sass';(folding any leading$varoverrides above the import intowith (…)) plus@use '@allxsmith/bestax-bulma/scss/extras';;bulmaemits plain@use 'bulma/sass';;keepdoes the same with a TODO explaining the replacement (worded to match whether--no-depskept the package). It deliberately does not emit the hard-configuredscss/bestaxbundle here — that bundle can't carry the user's own theme vars, and reconfiguringbulma/sasswhen another file already configures it is a hard Sass error. If the file already has its ownbulma/…root (a@use 'bulma/sass'of its own, or a Bulma@importthe codemod converts), the RBC root/index line (src/index, the bundleddist/*.css, or the bare specifier) is dropped instead of emitting a second root; inbestaxmode the extras are added once alongside that existing root. A dropped RBC deep partial (e.g.src/components/navbar.sass) is different —bulma/sassdoesn't necessarily carry a given partial's styles, so it gets a// TODO(bestax-migrate)and a report entry ("port any styles it carried beyond Bulma's own by hand") rather than vanishing silently.package.json: the source library removed,
@allxsmith/bestax-bulmaadded, a declared pre-1.0bulmaraised to^1.0.4(orbulmaadded when sources still importbulma/…directly). For rbx, the fourbulma-*extensions it pinned are reported for you to remove, not deleted — a manifest entry is a deliberate declaration, and the same goes for their CSS imports in source files (kept, with a TODO each), and deadnode-sassreplaced with dartsass. Run the package manager's install afterwards — the codemod never installs anything.
Flag reference: --css bulma keeps plain bulma/css/bulma.min.css and adds a separate
@allxsmith/bestax-bulma/extras.css import; --css keep leaves stylesheets alone;
--no-deps skips the package.json step.
Finishing the flagged cases
- Computed Sass variables (
$primary: lighten(#333, 10%);and anything with functions/interpolation): move them into thewith (…)configuration by hand —with (…)values must be compile-time literals, so resolve the expression or compute it after the@use. - Indented-syntax
.sassfiles: flagged, not rewritten. Convert@importlines to@use "bulma/sass" with (…)manually (same rules as SCSS, minus semicolons/braces). - Unknown 0.9 partial paths: the v1 sass tree is
bulma/sass/{utilities,base, elements,form,components,grid,layout,helpers,themes}with leaf partials likebulma/sass/utilities/initial-variables— find the equivalent module and@useit. - Third-party Bulma extensions (
bulma-checkradio,bulma-switch,bulma-tooltip, …): flagged, left in place. These are 0.9-era add-ons — check each one's Bulma v1 compatibility. Class-based usage (className="is-checkradio") keeps needing the extension; usage that migrated to bestax components (Radio, Checkbox, the advanced form controls) is already styled by the bestax extras, so the import can go. the source library's own stylesheet is never flagged this way (see above) — only packages actually namedbulma-*are.
Choosing a CSS flavor (optional)
bestax.css is right for almost every app. Alternatives (swap the import specifier):
| Import | Use when |
|---|---|
@allxsmith/bestax-bulma/versions/bestax-prefixed.css |
class conflicts with another framework — pair with <ConfigProvider classPrefix="bestax-"> |
@allxsmith/bestax-bulma/versions/bestax-no-helpers.css |
smallest CSS; helper props like mt="4" stop working |
@allxsmith/bestax-bulma/versions/bestax-no-helpers-prefixed.css |
both of the above |
@allxsmith/bestax-bulma/versions/bestax-no-dark-mode.css |
light-mode-only product |
Custom SCSS builds with bestax
Do not @use '@allxsmith/bestax-bulma/scss/bestax' when you need your own
$variable overrides — that entry pre-configures bulma/sass and Sass forbids
configuring a module twice. The correct pairing (what the codemod emits) is:
@use 'bulma/sass' with (
$primary: …
);
@use '@allxsmith/bestax-bulma/scss/extras';Per-component partials also exist (@use '@allxsmith/bestax-bulma/scss/components/dialog';,
…/scss/form/autocomplete, …) for modular builds.
Runtime theming
Bulma v1 themes with --bulma-* CSS variables at runtime (dark mode is automatic).
Sass with (…) is for compile-time tokens; for brand/dark-mode work use the bestax
Theme component — see the bestax-theming skill and
https://bestax.io/docs/guides/getting-started/migration/bulma-0-9-to-1 for the broader
0.9 → 1 changes (Tiles → Grid, is-bold gradients removed, automatic dark mode).