Category Page Customization
Overviewโ
This page documents the customization applied to generated docs category pages (generatedIndexPage) where Docusaurus renders files and folders as cards.
TODO:
- Reduce card padding from
2remto1.5rem - Reduce card title (
h2) top padding from15pxto5px - Remove default title emojis used by Docusaurus in card titles:
๐๏ธfor document links๐๏ธfor folder/category links
Before:

After the fix:

Swizzling Componentsโ
The emoji icons are injected directly by Docusaurus DocCard component logic. Because of this, CSS alone is not enough to fully remove the icons. To remove the emojis properly, the theme component was swizzled (ejected) and customized.
Since the emoji removal depends on a swizzled component, future Docusaurus upgrades may require comparing the custom code file with upstream DocCard changes.
Files Modifiedโ
| File | Change |
|---|---|
New: src/theme/DocCard/index.js | Swizzled DocCard and removed icon rendering from card titles |
New: src/theme/DocCard/styles.module.css | Added companion style module required by swizzled DocCard |
src/css/custom.scss | Added generated index pageโscoped overrides for card padding and card h2 top padding |
Implementationโ
1. Remove Doc and Category Emojisโ
In src/theme/DocCard/index.js, the original icon usage was removed:
- Category icon
๐๏ธis no longer passed to card layout - Link icon
๐๏ธ/๐is no longer passed to card layout - Card heading now renders title only
Result:
- Before:
๐๏ธ Creating a GIF,๐๏ธ Docusaurus - After:
Creating a GIF,Docusaurus
2. Generated Index Card Spacing Overridesโ
In src/css/custom.scss, the following scoped rules were added:
[class*="generatedIndexPage_"] {
.card.padding--lg {
padding: 1.5rem !important;
}
.card h2 {
padding-top: 5px;
}
}
This keeps the overrides limited to generated docs category pages and avoids changing card styles globally across unrelated pages.
Validation Checklistโ
- Open any generated docs category page
- Confirm card padding appears tighter (
1.5rem) - Confirm card title top spacing is reduced (
5px) - Confirm no
๐๏ธor๐๏ธprefix appears in card titles