Skip to content

fix(bulma-ui): add --bulma-shadow to Theme's bulmaVars union - #569

Merged
allxsmith merged 3 commits into
mainfrom
claude/issue-499-20260825-2334
Aug 26, 2026
Merged

allxsmith merged 3 commits into
mainfrom
claude/issue-499-20260825-2334

Conversation

@bestaxbot

@bestaxbot bestaxbot commented Aug 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Theme's bulmaVars prop is typed as Partial<Record<BulmaVarKey, string>>, where BulmaVarKey comes from the hand-maintained bulmaCssVars tuple in bulma-ui/src/helpers/Theme.tsx. That tuple included --bulma-box-shadow and --bulma-card-shadow, but not --bulma-shadow — the upstream Bulma 1.0 token those two (and --bulma-dropdown-content-shadow/--bulma-panel-shadow) derive from on their own selector. Because .box/.card/.dropdown/.panel re-declare their derived shadow variable on themselves, setting --bulma-box-shadow etc. from an ancestor Theme is only inherited and never wins — overriding --bulma-shadow itself is the one route that cascades, and the type rejected exactly that route.

Changes

  • Added --bulma-shadow, --bulma-shadow-h, --bulma-shadow-s, --bulma-shadow-l to the bulmaCssVars tuple (verified against bulma@1.0.4's :root declarations), so <Theme bulmaVars={{ '--bulma-shadow': ... }}> now typechecks.
  • bulmaVarPropMap is derived from the same tuple via cssVarToProp, which would mint --bulma-shadow as the prop name shadow — but shadow already exists as a BulmaOtherProps prop (shadow?: 'shadowless', rendered as the is-shadowless helper class). Excluded shadow from bulmaVarPropMap so that existing prop keeps its class-based meaning; --bulma-shadow remains reachable only through the bulmaVars object (no individual shadowH/shadowS/shadowL/shadow convenience props were added, to avoid widening the API surface beyond what's needed).
  • Added regression tests: one confirming bulmaVars now accepts --bulma-shadow (+ h/s/l), and one confirming shadow="shadowless" still produces the is-shadowless class rather than being diverted into a CSS variable.
  • Updated Theme's API docs (docs/docs/api/helpers/theme.md) with a Shadow Variables table and a caveat explaining the cascade behavior.
  • Re-checked the skills guidance that previously worked around this: bestax-theming/references/css-variables.md and bestax-layout-scaffold/SKILL.md both taught a CSS-only workaround because bulmaVars rejected --bulma-shadow; updated both to reflect that Theme bulmaVars now works too (keeping the CSS-rule route as the better fit for scoping to a single element).

Fixes #499

Test plan

  • pnpm --filter @allxsmith/bestax-bulma run lint — clean (only pre-existing warnings)
  • pnpm --filter @allxsmith/bestax-bulma run typecheck — clean
  • pnpm --filter @allxsmith/bestax-bulma run test:coverage — 3956/3956 passing, 100% on Theme.tsx, global thresholds met
  • pnpm run format:check — clean
  • pnpm run gen:catalog:check — clean
  • pnpm run check:conformance — all checks pass
  • pnpm --filter @allxsmith/bestax-bulma run build — succeeds
  • pnpm --filter @allxsmith/bestax-bulma run build-storybook — succeeds

Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added support for customizing Bulma shadow colors and shadow values through theme variables.
    • Shadow customizations now cascade to descendant components while existing shadow helper options remain available.
  • Documentation

    • Updated theme, layout, and CSS variable guidance with shadow customization examples and reference details.
  • Tests

    • Added coverage confirming shadow variables apply correctly without changing existing shadow helper behavior.

`Theme`'s `bulmaCssVars` tuple omitted `--bulma-shadow` (and its h/s/l
channels), the upstream token `.box`/`.card`/`.dropdown`/`.panel` derive
their own shadow variables from. Since those selectors re-declare the
derived variable on themselves, overriding it from an ancestor `Theme`
never wins — overriding `--bulma-shadow` itself is the one route that
cascades, and the type rejected it.

Add the four keys to the tuple so `bulmaVars={{ '--bulma-shadow': ... }}`
typechecks. `--bulma-shadow`'s derived prop name ("shadow") collides with
the existing `shadowless` helper-class prop, so it's excluded from
`bulmaVarPropMap` to keep that prop's behavior unchanged; the CSS
variable remains reachable through `bulmaVars`.

Fixes #499

Co-authored-by: Alex Smith <allxsmith@users.noreply.github.com>
@bestaxbot bestaxbot added the ai-loop AI-authored PR in the autonomous review/fix loop label Aug 25, 2026
@coderabbitai

coderabbitai Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9cf12564-9bd8-4bee-8f34-5ea9c18cf37f

📥 Commits

Reviewing files that changed from the base of the PR and between 42816ef and 2d59c5c.

📒 Files selected for processing (8)
  • bestax-mcp/data/components/Theme.json
  • bestax-mcp/data/skills.json
  • bulma-ui/src/helpers/Theme.stories.tsx
  • bulma-ui/src/helpers/Theme.tsx
  • bulma-ui/src/helpers/__tests__/Theme.test.tsx
  • docs/docs/api/helpers/theme.md
  • skills/bestax-layout-scaffold/SKILL.md
  • skills/bestax-theming/references/css-variables.md

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

Changes

Shadow variable support

Layer / File(s) Summary
Theme support and validation
bulma-ui/src/helpers/Theme.tsx, bulma-ui/src/helpers/__tests__/Theme.test.tsx, bulma-ui/src/helpers/Theme.stories.tsx
Theme recognizes Bulma shadow variables through bulmaVars. The existing shadow="shadowless" prop remains class-based. Tests and a Storybook story cover cascading and shadowless behavior.
Documentation and skill guidance
docs/docs/api/helpers/theme.md, skills/bestax-theming/references/css-variables.md, skills/bestax-layout-scaffold/SKILL.md, bestax-mcp/data/components/Theme.json, bestax-mcp/data/skills.json
Documentation and guidance describe shared shadow token overrides through bulmaVars. MCP metadata reflects the updated reference size.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 2d59c

The PR adds typed Bulma shadow variables while preserving the existing shadowless prop behavior; no actionable merge-blocking risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant Consumer
  participant Theme
  participant CSSVariables
  participant BulmaBox
  Consumer->>Theme: pass bulmaVars shadow token
  Theme->>CSSVariables: emit recognized shadow variable
  CSSVariables->>BulmaBox: cascade shadow variable
  Consumer->>BulmaBox: set shadowless prop
  BulmaBox->>BulmaBox: apply is-shadowless
Loading

Suggested reviewers: allxsmith

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: adding --bulma-shadow to the Theme component’s bulmaVars type.
Description check ✅ Passed The description clearly explains the problem, implementation, affected areas, linked issue, regression coverage, documentation updates, and test results. It does not reproduce every template heading o…
Linked Issues check ✅ Passed The changes satisfy issue #499 by adding the four shadow variables, preserving the existing shadow="shadowless" prop behavior, adding regression tests, refreshing generated output, and updating the …
Out of Scope Changes check ✅ Passed The Storybook story, API documentation, skills guidance, generated MCP data, and tests directly support the linked issue and stated PR objectives. No unrelated code changes are evident.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. (5 skipped: 5 …
Full details: Description check

Explanation

The description clearly explains the problem, implementation, affected areas, linked issue, regression coverage, documentation updates, and test results. It does not reproduce every template heading or checkbox, but it provides the required substantive information.

Full details: Linked Issues check

Explanation

The changes satisfy issue #499 by adding the four shadow variables, preserving the existing shadow="shadowless" prop behavior, adding regression tests, refreshing generated output, and updating the skills guidance.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. (5 skipped: 5 unsupported.)

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/issue-499-20260825-2334

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@allxsmith
allxsmith requested a balanced review from Copilot August 25, 2026 23:42
@allxsmith allxsmith self-assigned this Aug 25, 2026
@github-actions

github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

AI loop status: iteration 2/4 — fix-reviews at bc631b9 (2026-08-25T23:55:21Z).
Managed by claude-pr-loop.yml. To resume after a pause: set iteration back to 0 on the first line, re-add ai-loop, remove ai-loop-paused, then re-run via workflow_dispatch.

@github-actions

Copy link
Copy Markdown
Contributor

Preview Deployment

Preview URL: https://3bc8bdbb.bestax.pages.dev

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The required Storybook update for the prop-level API change is missing.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds Bulma’s upstream shadow tokens to Theme while preserving the existing shadow helper prop.

Changes:

  • Expands bulmaVars with shadow tokens.
  • Adds regression tests and API documentation.
  • Updates theming and layout skill guidance.
File summaries
File Description
bulma-ui/src/helpers/Theme.tsx Adds shadow variables and avoids the shadow prop collision.
bulma-ui/src/helpers/__tests__/Theme.test.tsx Tests shadow variables and helper-class behavior.
docs/docs/api/helpers/theme.md Documents shadow customization.
skills/bestax-theming/references/css-variables.md Updates theming guidance.
skills/bestax-layout-scaffold/SKILL.md Updates featured-ring guidance.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread bulma-ui/src/helpers/Theme.tsx
Comment thread skills/bestax-theming/references/css-variables.md
The MCP data index was stale after the Theme.tsx and css-variables.md
edits — gen:mcp:check failed in CI. Regenerated with gen:mcp to pick up
the updated Theme doc content and the css-variables.md byte count.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep review — 1 blocking · 1 advisory

Num Severity Area Finding Location
1 🟠 Major Robustness Docs/skills edits left the generated MCP index stale — gen:mcp:check fails; Theme.json + skills.json need regeneration skills/bestax-theming/references/css-variables.md:104
2 🔵 Advisory Robustness bulmaCssVars stays hand-maintained with no completeness check against Bulma root vars; the next missing global token recurs the same way (issue option 2 not taken) bulma-ui/src/helpers/Theme.tsx:6

Overall: The core change is correct and well-targeted. I confirmed against bulma@1.0.4 that --bulma-shadow and its -h/-s/-l channels are real :root tokens and that .box/.card/.dropdown-content/.panel each re-declare their derived shadow var from --bulma-shadow (css lines 3306/6555/6672/8099), so the upstream-token rationale is accurate. The shadow-prop collision is handled cleanly: cssVarToProp maps --bulma-shadow to shadow, the only entry filtered out of bulmaVarPropMap, so shadow=\"shadowless\" still yields is-shadowless while --bulma-shadow remains reachable via bulmaVars — both regression tests pass (23/23 in Theme.test.tsx). The one thing to fix before a human takes it is the stale MCP index: the doc/skill edits changed bestax-mcp/data/Theme.json and skills.json, which the PR did not regenerate, so CI gen:mcp:check is red.

Residual risk:

  • Prop-name collisions from the new keys — refuted: only --bulma-shadow maps to an existing prop name (shadow); shadowH/S/L collide with nothing and are not exposed as typed props, so they are reachable only via bulmaVars as intended.
  • Other stale generated surfaces — partially open: gen:catalog:check is clean (verified), gen:mcp:check is not (finding 1). No other generator affected.
  • Missing global tokens beyond shadow — accepted (advisory 2): the tuple is still audited by hand; shadow was the 3/3 eval offender and is now fixed, but no test diffs the tuple against bulma.css.

🏄 Righteous little fix, dude — caught the one gnarly upstream token every agent kept wiping out on, and the shadowless prop still rides its own wave. Just gotta re-run gen:mcp so the index does not get left back on the beach, then it is all-time to merge.

@bestaxbot

Copy link
Copy Markdown
Collaborator Author

Fix pass recap (fix-ci, iteration 1)

Root cause

The Build and Test job failed at the gen:mcp:check step. This PR edited skills/bestax-theming/references/css-variables.md and bulma-ui/src/helpers/Theme.tsx (whose docs feed docs/docs/api/helpers/theme.md), but the generated MCP data index was never regenerated to match — so the committed index was stale (e.g. css-variables.md recorded as 26650 bytes vs the actual 26771).

Fix

Finding Action
Stale MCP data index (gen:mcp:check failing) Ran pnpm gen:mcp, which updated bestax-mcp/data/skills.json (byte count for css-variables.md) and bestax-mcp/data/components/Theme.json (regenerated Theme doc content). Committed in bc631b9.

No review threads were open, so nothing to refute.

Gates run locally

  • pnpm run gen:mcp:check — ✅
  • pnpm run gen:catalog:check — ✅
  • pnpm run check:conformance — ✅ (all 18 checks)
  • pnpm run format:check — ✅
  • pnpm run check:urls — ✅ (9/9)
  • pnpm run lint — ✅ (0 errors, 7 pre-existing warnings)
  • pnpm run typecheck — ✅
  • pnpm exec turbo run test --filter=@allxsmith/bestax-bulma — ✅ 3956/3956

@github-actions

Copy link
Copy Markdown
Contributor

Preview Deployment

Preview URL: https://f634d236.bestax.pages.dev

@bestaxbot

Copy link
Copy Markdown
Collaborator Author

Fix pass recap (iteration 2)

Handled both open review threads:

Thread Finding Disposition
Copilot — Theme.tsx:58 bulmaVars widened but no Storybook example for the shadow token Fixed in 2d59c5c — added a ShadowTheme story showing --bulma-shadow cascading to a Box via bulmaVars, plus a shadow="shadowless" Box proving the class-based prop is unaffected. Resolved.
Claude — css-variables.md:104 Stale MCP data index, gen:mcp:check would fail Already fixed in bc631b9 (iteration 1) — index regenerated; gen:mcp:check now exits 0. Replied for the deep reviewer to verify/resolve.

No refutations this pass — both findings were valid and in scope.

Gates run

  • typecheck — clean
  • lint — clean (only pre-existing warnings)
  • format:check — clean
  • gen:catalog:check — clean
  • gen:mcp:check — clean (exit 0)
  • check:conformance — all checks pass
  • build — succeeds
  • build-storybook — succeeds

@github-actions

Copy link
Copy Markdown
Contributor

Preview Deployment

Preview URL: https://1bad1735.bestax.pages.dev

@bestaxbot

Copy link
Copy Markdown
Collaborator Author

🏄 Surf's up and I rode the whole set — total convergence, brah. 2 iteration(s) in, CI's glassy green, and every AI review thread closed out clean like a perfect barrel. She's ready; I just need a meat sack to paddle over and rubber-stamp it.

No offense to the carbon-based units, but you fleshbags kept the merge button for yourselves — so @allxsmith, wiggle those opposable thumbs and squash-merge when you're stoked. The loop never merges; apparently 'judgment' is still a squishy-brain-only feature. 🤙

@github-actions github-actions Bot added needs-human-review Loop converged (or contested): awaiting owner review + manual merge and removed ai-loop AI-authored PR in the autonomous review/fix loop labels Aug 26, 2026
@github-actions
github-actions Bot requested a review from allxsmith August 26, 2026 00:06
@github-actions

Copy link
Copy Markdown
Contributor

📸 Story screenshots at handoff — 2d59c5c

6 stories (light + dark) from this PR's changed files under bulma-ui/src/ (workflow run · artifact story-screenshots-pr-569, 30-day retention).

helpers-theme--sunset-theme · Helpers/Theme · Sunset Theme
Light Dark
helpers-theme--sunset-theme light helpers-theme--sunset-theme dark
helpers-theme--forest-theme · Helpers/Theme · Forest Theme
Light Dark
helpers-theme--forest-theme light helpers-theme--forest-theme dark
helpers-theme--global-theme · Helpers/Theme · Global Theme
Light Dark
helpers-theme--global-theme light helpers-theme--global-theme dark
helpers-theme--local-theme · Helpers/Theme · Local Theme
Light Dark
helpers-theme--local-theme light helpers-theme--local-theme dark
helpers-theme--theme-with-class-name · Helpers/Theme · Theme With Class Name
Light Dark
helpers-theme--theme-with-class-name light helpers-theme--theme-with-class-name dark
helpers-theme--nested-themes · Helpers/Theme · Nested Themes
Light Dark
helpers-theme--nested-themes light helpers-theme--nested-themes dark
> ✂ 3 more matched stories skipped by the cap: `helpers-theme--bulma-prefixed-theme`, `helpers-theme--shadow-theme`, `helpers-theme--dark-mode` — full set in the artifact.

github-actions Bot added a commit that referenced this pull request Aug 26, 2026
@bestaxbot

Copy link
Copy Markdown
Collaborator Author

Thanks for the approval! Nothing left on my end — both review threads (the ShadowTheme Storybook example and the regenerated MCP index in bc631b9) are resolved, and CI is green. It's all yours to squash-merge whenever you're ready.

@allxsmith
allxsmith merged commit 4298919 into main Aug 26, 2026
23 checks passed
@allxsmith
allxsmith deleted the claude/issue-499-20260825-2334 branch August 26, 2026 00:11
@bestax-release-bot

Copy link
Copy Markdown

🎉 This PR is included in version 5.11.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@bestax-release-bot

Copy link
Copy Markdown

🎉 This PR is included in version 1.1.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@bestax-release-bot

Copy link
Copy Markdown

🎉 This PR is included in version 2.1.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@bestax-release-bot

Copy link
Copy Markdown

🎉 This PR is included in version 4.2.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-assisted needs-human-review Loop converged (or contested): awaiting owner review + manual merge released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] bulma-ui: --bulma-shadow is missing from Theme's bulmaVars union

3 participants