Skip to content

fix(css): restore JT brand red CTA buttons + pin bun#337

Merged
pftg merged 2 commits into
masterfrom
fix/pin-bun-stop-css-drift
May 11, 2026
Merged

fix(css): restore JT brand red CTA buttons + pin bun#337
pftg merged 2 commits into
masterfrom
fix/pin-bun-stop-css-drift

Conversation

@pftg
Copy link
Copy Markdown
Member

@pftg pftg commented May 11, 2026

Symptom

Production homepage CTA buttons rendered as default blue pills instead of JT Ruby red (#cc342d) rectangular brand buttons. User reported "we lost previous design."

Investigation chain

  1. Initial suspicion: PR feat(perf): Beasties critical CSS — homepage-only #335 Beasties merge. Confirmed via reproduction: PR feat(perf): Beasties critical CSS — homepage-only #335 CI workflow never invoked bin/inline-critical, so deployed CSS bundle was unchanged. Reverted (Revert "feat(perf): Beasties critical CSS — homepage-only (#335)" #336) for safety; no impact on the broken state — symptom persists.
  2. Comparing production CSS bundle (df726d1a...css, 222507 bytes) against local build (42f525ea...css, 225143 bytes) showed local is 2636 bytes larger and contains rules production is missing.
  3. The missing rule lives in themes/beaver/assets/css/navigation.css:
    a.fl-button, a.fl-button:visited, .fl-button-wrap a {
      background-color: #cc342d !important;
      border-radius: 8px !important;
      ...
    }
    This is the JT brand red override that paints all FL-builder CTAs site-wide. Local build preserves it (verified in inlined <style> block). Production strips it.
  4. The rule went through PostCSS + PurgeCSS in both builds. CI's PurgeCSS removed it; local's didn't. Likely cause: hugo_stats.json read-timing race against Hugo's incremental writes — when PostCSS processes the inline navigation.css bundle, the stats file may not yet contain fl-button class on CI, even though it does locally.

Fixes (two layered)

1. postcss.config.js — Add brand CTA class names to safelist.standard:

  • btn, btn-primary (pagination Next, page nav, header Contact Us)
  • fl-button, fl-button-wrap (homepage hero, every Beaver Builder CTA)
  • action-button (Use Cases tab CTAs)

Standard safelist matches classes regardless of hugo_stats.json content — these rules are now unconditionally preserved.

2. bun-version: 1.3.13 (both _hugo.yml and setup-hugo/action.yml) — Replace latest with a known-good pin. latest is time-dependent and contributed to non-deterministic CI builds across deploys of the same git SHA.

Verification

  • Local production build preserves #cc342d red rule in inlined <style> block
  • CSS bundle hash unchanged (42f525ea) — confirms safelist addition didn't break unrelated rules
  • CI build on this PR produces same bundle (in progress)
  • After merge: production deploy restores red brand buttons

🤖 Generated with Claude Code

bun-version: latest caused production CSS to differ from local builds.
When bun's latest version rolled, CI started producing a CSS bundle
(homepage.min.df726d1a...css) that was missing the `a.fl-button {
background-color: #cc342d !important }` brand override from
navigation.css — buttons rendered as default blue pills instead of
JT brand red. Local build with bun 1.3.13 produces the correct bundle
(homepage.min.42f525ea...css) with the rule intact.

Pin to 1.3.13 (known-good, matches user's local) to make CI deterministic
and stop CSS drift across deploys of the same git SHA.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

Warning

Rate limit exceeded

@pftg has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 21 minutes and 22 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6599c749-8439-4a6b-bae9-12f016000d1a

📥 Commits

Reviewing files that changed from the base of the PR and between 7160cb1 and e3391f2.

📒 Files selected for processing (3)
  • .github/actions/setup-hugo/action.yml
  • .github/workflows/_hugo.yml
  • postcss.config.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pin-bun-stop-css-drift

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 and usage tips.

Production homepage's CTA buttons rendered as default blue pills
instead of the JT Ruby red (#cc342d) brand override. Root cause:
PurgeCSS in CI was stripping the navigation.css rule

  a.fl-button, a.fl-button:visited, .fl-button-wrap a {
    background-color: #cc342d !important;
    border-radius: 8px !important;
    ...
  }

despite hugo_stats.json containing the fl-button class. CI's PurgeCSS
behavior differs from local — possibly a timing race between Hugo's
incremental hugo_stats.json writes and PostCSS's read of that file
when processing the inline navigation.css bundle.

Fix: add brand CTA class names to safelist.standard. Standard safelist
matches classes regardless of hugo_stats.json content — the rule's
selector contains any of these classes → rule is preserved
unconditionally.

Classes added:
- btn, btn-primary (pagination Next, page nav, header Contact Us)
- fl-button, fl-button-wrap (homepage hero, about-us footer, every
  Beaver Builder CTA module)
- action-button (Use Cases tab CTAs)

Verified locally: red brand rule appears in inlined navigation <style>
block of generated index.html. Same CSS bundle hash as before
(42f525ea) — no unintended changes elsewhere.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pftg pftg changed the title fix(ci): pin bun to 1.3.13 to stop CSS bundle drift fix(css): restore JT brand red CTA buttons + pin bun May 11, 2026
@pftg pftg merged commit d3ef9cb into master May 11, 2026
3 checks passed
@pftg pftg deleted the fix/pin-bun-stop-css-drift branch May 11, 2026 07:16
pftg added a commit that referenced this pull request May 11, 2026
)

fix(css): use greedy safelist for fl-button + btn to preserve brand override

Follow-up to #337: standard safelist preserved .btn.btn-primary
(class-only selector matched) but failed for a.fl-button
(tag+class compound). PurgeCSS treats class-only and tag+class
selectors differently for safelist matching, and only the class-only
rule survived. Result: Contact Us header button got brand red,
but hero CTAs ("Talk to an Expert", "Explore Use Cases") stayed
default blue pill.

Move fl-button, btn, action-button to safelist.greedy — preserves any
rule whose selector mentions these classes regardless of tag prefix.

Verified locally: red rule appears in inlined navigation <style>:
  .fl-button-wrap a, a.fl-button, a.fl-button:visited {
    background-color: #cc342d !important;
    border-radius: 8px !important;
    ...
  }

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant