Skip to content

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

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

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

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"}}>

docs/external/mod-command.mdx:

<tr style={{display: "flex", flexDirection: "row"}}>

docs/contribute/search.mdx:

<th style={{padding: "5px"}}><strong>Filter</strong></th>

docs/external/migration_tool.mdx:

<div style={{display: "flex", flexWrap: "wrap", gap: "16px"}}>

Fixes #30658
Fixes #30668

Test plan

  • Mintlify preview / local docs build succeeds for the listed pages
  • Spot-check rendered tables, iframe, and migration tool layout in the browser

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

Copy link
Copy Markdown

✅ Bazel docs preview is ready!

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

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.

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.

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

1 participant