Skip to content

docs: format MD and MDX docs#22000

Merged
tay1orjones merged 5 commits into
carbon-design-system:mainfrom
adamalston:n/a-mdx
Apr 28, 2026
Merged

docs: format MD and MDX docs#22000
tay1orjones merged 5 commits into
carbon-design-system:mainfrom
adamalston:n/a-mdx

Conversation

@adamalston

@adamalston adamalston commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

No issue.

Formatted MD and MDX docs.

Changelog

New

  • Added MDX formatting to lint-staged.

Changed

  • Formatted MD and MDX docs.
  • Fixed markdown alerts.
  • Fixed doc issues.

Removed

Testing / Reviewing

yarn format
yarn format:diff

An example of an issue the changes in this pull request fix is in https://github.com/carbon-design-system/carbon/blob/597001a9b6710da9531883b65a0852fde9ff199d/docs/guides/reviewing-pull-requests.md. The alert at the top of the file isn't rendered due to an issue with the way it's written.

I left a TODO with a question. I'm curious if anyone has any input. If there is no clear answer, I can try removing the component in a follow-up to determine whether it's still needed.

PR Checklist

As the author of this PR, before marking ready for review, confirm you:

  • Reviewed every line of the diff
  • Updated documentation and storybook examples
  • Wrote passing tests that cover this change
  • Addressed any impact on accessibility (a11y)
  • Tested for cross-browser consistency
  • Validated that this code is ready for review and status checks should pass

More details can be found in the pull request guide

@netlify

netlify Bot commented Apr 11, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit 1e14667
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/69efe28d787e33000898a625
😎 Deploy Preview https://deploy-preview-22000--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Apr 11, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 1e14667
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/69efe28d0012e400083cfa2b
😎 Deploy Preview https://deploy-preview-22000--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Apr 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.05%. Comparing base (6898a87) to head (1e14667).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #22000      +/-   ##
==========================================
- Coverage   95.07%   95.05%   -0.03%     
==========================================
  Files         539      539              
  Lines       45139    45139              
  Branches     6512     6539      +27     
==========================================
- Hits        42918    42905      -13     
- Misses       2092     2105      +13     
  Partials      129      129              
Flag Coverage Δ
main-packages 89.10% <ø> (ø)
web-components 97.87% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@devadula-nandan devadula-nandan 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.

Thanks for this pr 🎉
1 question

Comment on lines +262 to +272
<Button
renderIcon={(props) => <Add size={24} {...props} />}
iconDescription="Add">
Add
</Button>
<Button
renderIcon={(props) => <TrashCan size={24} {...props} />}
kind="danger"
iconDescription="TrashCan">
Delete
</Button>

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.

Do you have any idea why formatting this mdx file is messing up the buttons content placing them in p tag?

Screen.Recording.2026-04-13.at.4.01.34.PM.mov

I have observed this in an other pr and avoided formatting the mdx there.
#21390 (comment)
I am not sure if there are any more cases like this in other mdx files.

Will wrapping them in storybook unstyled fixes them? could be related to these efforts 🤔

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.

This could be an issue with storybook mdx parsing too. But need to verify.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There's a rendering issue with MDX parsing. Newline separated text within JSX can be interpreted as Markdown, causing it to render as p elements. I updated the code to use JavaScript expression children so the content is treated as plain text nodes.

https://mdxjs.com/docs/what-is-mdx/#interleaving
storybookjs/storybook#18921

I am not sure if there are any more cases like this in other mdx files.

There are. Would you like me to fix them here or in a separate pull request? Adding an MDX lint rule for multiline text children in JSX may help prevent similar issues in the future.

  • <Unstyled>
    <Button as="div" role="button">
    a11y Button
    </Button>
    </Unstyled>
  • <LinkTo title="Hooks/usePrefix" name="Overview">
    usePrefix
    </LinkTo>
  • <Unstyled>
    <InlineNotification
    kind="warning"
    title="Warning"
    className="sb-notification">
    <CodeSnippet type="inline" hideCopyButton>
    Modal
    </CodeSnippet>
    and
    <CodeSnippet type="inline" hideCopyButton>
    ComposedModal
    </CodeSnippet>
    have to be put at the top level in a React tree. The easiest way to ensure
    that is using a React portal, as shown in the example above.
    </InlineNotification>
    </Unstyled>
  • <Unstyled>
    <InlineNotification
    kind="warning"
    title="Warning"
    className="sb-notification">
    As the instructions for the three buttons imply,
    <CodeSnippet type="inline" hideCopyButton>
    ModalFooter
    </CodeSnippet>
    is flexible with the buttons you render using
    <CodeSnippet type="inline" hideCopyButton>
    Button
    </CodeSnippet>
    components. In this case, your application code is responsible for handling
    button actions, such as closing the modal.
    </InlineNotification>
    </Unstyled>
  • <Unstyled>
    <InlineNotification
    kind="warning"
    title="Warning"
    className="sb-notification">
    <CodeSnippet type="inline" hideCopyButton>
    Modal
    </CodeSnippet>
    and
    <CodeSnippet type="inline" hideCopyButton>
    ComposedModal
    </CodeSnippet>
    have to be put at the top level in a React tree. The easiest way to ensure
    that is using a React portal, as shown in the example above.
    </InlineNotification>
    </Unstyled>
  • <Unstyled>
    <InlineNotification
    kind="warning"
    title="Warning"
    className="sb-notification">
    As the instructions for the three buttons imply,
    <CodeSnippet type="inline" hideCopyButton>
    ModalFooter
    </CodeSnippet>
    is flexible with the buttons you render using
    <CodeSnippet type="inline" hideCopyButton>
    Button
    </CodeSnippet>
    components. In this case, your application code is responsible for handling
    button actions, such as closing the modal.
    </InlineNotification>
    </Unstyled>

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.

Great findings!
thanks for looking into this.

fixing the lint rules in a seperate pr makes sense to me

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread .editorconfig
Comment thread packages/react/src/components/ComboBox/ComboBox.mdx Outdated

@tay1orjones tay1orjones left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Appreciate you 🙏

@tay1orjones tay1orjones added this pull request to the merge queue Apr 28, 2026
Merged via the queue into carbon-design-system:main with commit 51624f6 Apr 28, 2026
38 of 39 checks passed
@adamalston adamalston deleted the n/a-mdx branch April 29, 2026 01:28
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.

3 participants