Index of every page on this site: llms.txt
All skills
allxsmith avatar

/bestax-migrate

@9cf369a
by Alex Smithallxsmith/bestax15 stars
2
Run it yourself

Migrate an existing React app to @allxsmith/bestax-bulma on Bulma v1, from raw Bulma CSS classes on plain JSX (className="button is-primary") or in static HTML pages and templates styled with Bulma, or from an unmaintained React Bulma library (react-bulma-components v4, rbx v2, bloomer 0.6). Run the bestax-migrate codemod, then resolve every TODO(bestax-migrate) comment it leaves using the per-source mapping references. Use when a React app styles its markup with Bulma classes and wants bestax components instead, when static HTML pages or templates styled with Bulma should become React components, when a repo imports react-bulma-components, rbx or bloomer, when TODO(bestax-migrate) comments are present in a codebase, or when asked to convert Bulma classNames to bestax-bulma.

Use this Skill: https://skilld.dev/gh/allxsmith/bestax/bestax-migrate

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencescss-migration.md

≈2.5k tokens on demand. Your agent reads this file only when SKILL.md points to it.

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).css and 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 separate extras.css import next to it is collapsed. Visual note: bestax.css ships with $primary set to bestax blue (#1e6b99), not Bulma's stock turquoise — is-primary surfaces (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-l and --bulma-primary-on-scheme-l along with --bulma-primary-h, --bulma-primary-s and --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 of bestax.css, copy those five from Bulma's own bulma/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; the bestax-theming skill's references/css-variables.md ("The lightnesses Bulma's build picks for contrast") shows how, and what reads each one. Text the page colors with has-text-primary converts to textColor="primary", which reads the trio's own lightness on the light scheme, under 2:1 on white for turquoise (in stock Bulma too); add colorShade="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 _all aggregator 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 @use then 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/… or rbx/… specifier, bare, ~-prefixed, or a relative node_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-deps is passed) package.json no longer lists it, so the import can never resolve once installed. Every --css mode 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 $var overrides above the import into with (…)) plus @use '@allxsmith/bestax-bulma/scss/extras';; bulma emits plain @use 'bulma/sass';; keep does the same with a TODO explaining the replacement (worded to match whether --no-deps kept the package). It deliberately does not emit the hard-configured scss/bestax bundle here — that bundle can't carry the user's own theme vars, and reconfiguring bulma/sass when another file already configures it is a hard Sass error. If the file already has its own bulma/… root (a @use 'bulma/sass' of its own, or a Bulma @import the codemod converts), the RBC root/index line (src/index, the bundled dist/*.css, or the bare specifier) is dropped instead of emitting a second root; in bestax mode the extras are added once alongside that existing root. A dropped RBC deep partial (e.g. src/components/navbar.sass) is different — bulma/sass doesn'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-bulma added, a declared pre-1.0 bulma raised to ^1.0.4 (or bulma added when sources still import bulma/… directly). For rbx, the four bulma-* 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 dead node-sass replaced with dart sass. 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 the with (…) configuration by hand — with (…) values must be compile-time literals, so resolve the expression or compute it after the @use.
  • Indented-syntax .sass files: flagged, not rewritten. Convert @import lines 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 like bulma/sass/utilities/initial-variables — find the equivalent module and @use it.
  • 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 named bulma-* 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).

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts18d3 checks · Risk SAFE
  • Gen Agent Trust Hub18d

    The skill provides comprehensive instructions and reference material for migrating React applications or static HTML pages to the @allxsmith/bestax-bulma library using the bestax-migrate codemod. No malicious patterns or security risks were identified.

  • Socket18d

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

Signed by skilld at 9cf369a. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 4 days ago

README badge

README badge for allxsmith/bestax/bestax-migrate