mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-24 14:36:59 +02:00
feat(theme-classic, plugin-docs): sidebar item level-specific className + allow customization (#5642)
* Initial work * Complete function * Avoid duplication * More dedupe * Make everything constants * Change casing & docs
This commit is contained in:
parent
f6ec757aa0
commit
eaacb0e98a
14 changed files with 79 additions and 11 deletions
|
@ -173,6 +173,7 @@ type SidebarItemDoc =
|
|||
type: 'doc';
|
||||
id: string;
|
||||
label: string; // Sidebar label text
|
||||
className?: string; // Class name for sidebar label
|
||||
}
|
||||
|
||||
// Shorthand syntax
|
||||
|
@ -244,6 +245,7 @@ type SidebarItemLink = {
|
|||
type: 'link';
|
||||
label: string;
|
||||
href: string;
|
||||
className?: string;
|
||||
};
|
||||
```
|
||||
|
||||
|
@ -282,6 +284,7 @@ type SidebarItemCategory = {
|
|||
type: 'category';
|
||||
label: string; // Sidebar label text.
|
||||
items: SidebarItem[]; // Array of sidebar items.
|
||||
className?: string;
|
||||
|
||||
// Category options:
|
||||
collapsible: boolean; // Set the category to be collapsible
|
||||
|
@ -519,7 +522,8 @@ This is the easy tutorial!
|
|||
```json title="docs/tutorials/_category_.json"
|
||||
{
|
||||
"label": "Tutorial",
|
||||
"position": 3
|
||||
"position": 3,
|
||||
"className": "red"
|
||||
}
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue