[accordion][collapsible] Expose panel sizes as unitless values
Open
component: accordion
component: collapsible
type: new feature
- Dominant language
- TypeScript
- Stars
- 10.9k
- Forks
- 543
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 101
Description
# Feature request
## Summary
Base UI currently exposes `--accordion-panel-height` and `--accordion-panel-width` as CSS variables, which are useful for transitioning the panel's size. However, these values include `px`, which makes them less flexible for cases like calculating dynamic transition-duration.
It would be helpful if Base UI also exposed unitless size values (e.g. `--accordion-panel-height-value`) so that consumers could use them in `calc()`.
## Motivation
I would like to create "duration by distance" transitions for accordion panels, where the animation duration scales with panel size.
Contributor guide
Assessment
This issue has not been assessed yet.