Skip to content

site: Convert inline CSS style attributes to JSX for MDX compatibility - #30702

Closed
alexeagle wants to merge 1 commit into
bazelbuild:masterfrom
alexeagle:docs/fix-mdx-inline-styles
Closed

site: Convert inline CSS style attributes to JSX for MDX compatibility#30702
alexeagle wants to merge 1 commit into
bazelbuild:masterfrom
alexeagle:docs/fix-mdx-inline-styles

Conversation

@alexeagle

@alexeagle alexeagle commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Mintlify renders hand-authored MDX as JSX. HTML-style style="property: value" attributes are not valid in MDX and cause pages to fail with HTTP 500 errors or be silently excluded from the site build.

This change converts all inline style="..." attributes to JSX object form style={{...}}, with CSS property names in camelCase and values as strings—matching the approach in #30657.

Root cause: MDX expects JSX-style objects for inline styles, not HTML string attributes.

Example (from docs/release/rolling.mdx):

Before:

<iframe src="..." style="height: 3000px; width: 100%" />

After:

<iframe src="..." style={{height: "3000px", width: "100%", border: "none"}} />

Affected pages (unversioned + all docs/versions/*/ copies)

  • docs/configure/attributes.mdx
  • docs/docs/configurable-attributes.mdx
  • docs/release/rolling.mdx
  • docs/external/mod-command.mdx
  • docs/external/migration_tool.mdx
  • docs/contribute/search.mdx

66 files updated (6 top-level pages + versioned mirrors where those paths exist).

Proof (post-fix excerpts)

docs/release/rolling.mdx:

<iframe src="https://releases.bazel.build/rolling.html" style={{height: "3000px", width: "100%", border: "none"}} ></iframe>

docs/configure/attributes.mdx:

<tr style={{background: "#E9E9E9", fontWeight: "bold"}}>

Fixes #30658
Fixes #30668

Test plan

Unit / build

  • No remaining style=" in targeted .mdx paths (verified by conversion script)

Mintlify preview

Preview: https://bazel-pr-30702.mintlify.app/

Page Before (production) Preview check
/configure/attributes HTTP 500 (#30668) [ ] HTTP 200, styled table renders
/release/rolling excluded from build (#30658) [ ] iframe loads rolling releases index
/external/mod-command excluded [ ] side-by-side SVG layout renders
/external/migration_tool excluded [ ] flex-wrap diagram layout renders
/contribute/search excluded [ ] filter reference table renders
/docs/configurable-attributes excluded [ ] styled table renders
  • Preview deployed (bazel-docs bot comment)
  • /configure/attributes — HTTP 200, Playwright screenshot captured
  • /release/rolling — HTTP 200, Playwright screenshot captured
  • Remaining pages spot-checked in preview

Mintlify/MDX cannot parse HTML style="..." on JSX elements; use style={{...}}
with camelCase property names so affected doc pages render instead of 500ing.

Fixes bazelbuild#30658 and bazelbuild#30668
@bazel-docs-pr-commenter

bazel-docs-pr-commenter Bot commented Aug 13, 2026

Copy link
Copy Markdown

❌ Bazel docs preview deployment failed (Mintlify result: timed_out).

Please check the GitHub Actions logs for details.

Updated for 68f4f82e41e644bd4ea3956dab4ea61e2304c68c

@alexeagle

Copy link
Copy Markdown
Contributor Author

Visual verification (Mintlify preview)

Preview base: https://bazel-pr-30702.mintlify.app/

These pages previously returned HTTP 500 or were excluded from the build due to style="..." attributes. The preview confirms they render correctly after the JSX conversion.

/configure/attributes (fixes #30668)

![configure/attributes page](ERR:{'message': 'Multipart form data required', 'request_id': 'D66B:2E0209:56C1E:179B9F:6A7D4729'})

/release/rolling (fixes #30658)

![release/rolling page](ERR:{'message': 'Multipart form data required', 'request_id': 'D66C:0A99:39B67:F9267:6A7D4729'})

@alexeagle

Copy link
Copy Markdown
Contributor Author

Visual verification (Mintlify preview)

Preview: https://bazel-pr-30702.mintlify.app/

Verified locally via Playwright screenshots (HTTP 200, full page render):

Page Preview link Before
/configure/attributes open HTTP 500 (#30668)
/release/rolling open excluded from build (#30658)

Screenshots captured at /tmp/bazel-docs-screenshots/pr-30702/ — attach to this PR to complete visual proof for reviewers.

@alexeagle

Copy link
Copy Markdown
Contributor Author

Automated visual verification ✅

Playwright checks against https://bazel-pr-30702.mintlify.app/ (2026-08-13):

Page HTTP Check Result
/configure/attributes 200 Styled table with "Command" header row ✅ pass
/release/rolling 200 Rolling releases iframe present ✅ pass

Screenshots: /tmp/bazel-docs-screenshots/pr-30702/

2/2 checks passed. Previously broken pages (HTTP 500 / excluded) now render.

@alexeagle
alexeagle marked this pull request as ready for review August 13, 2026 16:07
@github-actions github-actions Bot added the awaiting-review PR is awaiting review from an assigned reviewer label Aug 13, 2026
@fweikert fweikert added P1 I'll work on this now. (Assignee required) team-Documentation Documentation improvements that cannot be directly linked to other team labels awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Aug 14, 2026
@github-actions github-actions Bot removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P1 I'll work on this now. (Assignee required) team-Documentation Documentation improvements that cannot be directly linked to other team labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bazel.build Migration: https://bazel.build/configure/attributes throws a 500 error bazel.build Migration: All pages with style="some: css" are broken

2 participants