Skip to content

minor accessbility improvements#187

Merged
Harsh062 merged 1 commit into
mainfrom
harsh/he-5120-accessbility-improvements-in-hashnode-theme
Nov 1, 2024
Merged

minor accessbility improvements#187
Harsh062 merged 1 commit into
mainfrom
harsh/he-5120-accessbility-improvements-in-hashnode-theme

Conversation

@Harsh062

@Harsh062 Harsh062 commented Nov 1, 2024

Copy link
Copy Markdown
Contributor

No description provided.

@vercel

vercel Bot commented Nov 1, 2024

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
starter-kit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 6:26am

type="button"
className="pl-2.5 text-slate-400"
aria-label={childrenVisibility ? `Collapse ${node.title}` : `Expand ${node.title}`}
aria-expanded={childrenVisibility}

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.

childrenVisibility controls the visibility of child nodes in the TOC.
It toggles between true (expanded) and false (collapsed) when the user clicks the button to expand or collapse a TOC section.

aria-label={node.title}
/>
</div>
{node.hasChildren ? (

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.

hasChildren indicates if the current node has any child elements within the TOC.
This helps render the expand/collapse button only when there are child items.

@Harsh062 Harsh062 merged commit dd8209d into main Nov 1, 2024
hoangsvit pushed a commit to hoangsvit/hashnode-starter-kit that referenced this pull request Jul 15, 2025
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.

2 participants