Skip to content

fix: cap sidebar collapse animation to 200ms#938

Merged
jth-nw merged 1 commit into
devfrom
fix/api-sidebar-collapse-animation
May 15, 2026
Merged

fix: cap sidebar collapse animation to 200ms#938
jth-nw merged 1 commit into
devfrom
fix/api-sidebar-collapse-animation

Conversation

@DanPiazza-Netwrix
Copy link
Copy Markdown
Contributor

Summary

  • Docusaurus calculates sidebar collapse transition duration proportional to content height
  • The API Reference section (112 tag groups, ~4340px) triggered a ~778ms animation — nearly a second of perceived delay when collapsing the category
  • One CSS rule in src/css/custom.css caps transition-duration to 200ms (--ifm-transition-fast) across all sidebar menu lists, eliminating the sluggishness

Why !important

The duration is set as an inline style by Docusaurus's useCollapsible hook (transition: height 778ms ease-in-out). CSS stylesheets cannot override inline styles without !important. The rule is scoped to .theme-doc-sidebar-menu .menu__list to limit its reach to the sidebar only.

Test plan

  • Navigate to any Change Tracker 8.1 API endpoint (e.g. /docs/changetracker/8_1/api/reference/acknowledge-events-get)
  • Click the API Reference chevron to collapse — should snap closed in ~200ms with no perceptible delay
  • Verify other collapsible sections (Requirements, Administration, etc.) still animate normally

Generated with AI

Co-Authored-By: Claude Code ai@netwrix.com

Docusaurus computes collapse transition duration proportional to content
height. The API Reference section has 112 tag groups (~4340px), causing
the default formula to produce ~778ms — nearly a second of animation when
collapsing the category.

One CSS rule capping transition-duration to 200ms (matching
--ifm-transition-fast) eliminates the delay site-wide without affecting
any other behavior. !important is required to override the inline style
set by Docusaurus's useCollapsible hook.

Generated with AI

Co-Authored-By: Claude Code <ai@netwrix.com>
@jth-nw jth-nw merged commit 749c692 into dev May 15, 2026
7 checks passed
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