Skip to content

Commit 9471b51

Browse files
milldrclaude
andauthored
style: restore list bullets and numbering in documentation (#872)
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent ef97ad6 commit 9471b51

2 files changed

Lines changed: 31 additions & 5 deletions

File tree

package-lock.json

Lines changed: 2 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/theme/MDXComponents.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,40 @@ import CategoryList from '@site/src/components/CategoryList';
1212

1313
library.add(fab, fas, far); // Add all icons to the library so you can use them without importing them individually.
1414

15+
// Custom list components with Tailwind classes to restore styling removed by Preflight
16+
function Ul({ children, ...props }) {
17+
return (
18+
<ul className="list-disc pl-8 my-4" {...props}>
19+
{children}
20+
</ul>
21+
);
22+
}
23+
24+
function Ol({ children, ...props }) {
25+
return (
26+
<ol className="list-decimal pl-8 my-4" {...props}>
27+
{children}
28+
</ol>
29+
);
30+
}
31+
32+
function Li({ children, ...props }) {
33+
return (
34+
<li className="my-1" {...props}>
35+
{children}
36+
</li>
37+
);
38+
}
39+
1540
export default {
1641
// Re-use the default mapping
1742
...MDXComponents,
1843
Icon: Icon, // Make the iconify Icon component available in MDX as <Icon />.
1944
FAIcon: FontAwesomeIcon, // Make the FontAwesomeIcon component available in MDX as <FAIcon />.
2045
// Add custom components
2146
CategoryList: CategoryList, // Make the CategoryList component available in MDX as <CategoryList />.
47+
// Override HTML elements with Tailwind-styled versions
48+
ul: Ul,
49+
ol: Ol,
50+
li: Li,
2251
};

0 commit comments

Comments
 (0)