-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create v6 Accordion with Styled System #391
Create v6 Accordion with Styled System #391
Conversation
Replaces styleOverrides prop functionality with Styled System props.
The pattern we've been using is to add a new file and export it at the /v6 entrypoint. While we will be making the v6 breaking change soon, we want to keep the v5 versions free of breaking changes until that point so that we're always in a shippable state. |
I went with the "legacy" naming scheme, renaming old files to How's this look? |
Accordion.Panel was the only child component that the old styleOverrides prop affected, so that's why it's the only one I mentioned here.
The variant prop already has a default in the destructured props, and the expandedSections prop is required.
As a step toward the v6 release (#378), how's this look for replacing the
styleOverrides
prop inAccordion
?The only property in
styleOverrides
used inAccordion
waspanelPadding
, which setpadding
on all nestedAccordion.Panel
s, so here are the main replacements:Added Styled System's variant API to
Accordion.Panel
to define the default and'minimal'
padding styles, then added thespace
field to allow overridingpadding
on individual panels.Added a custom
panelPadding
prop toAccordion
, applying its effects only to nestedPanel
s fromAccordion.Panel
. This way it's still possible to set thepadding
of all panels at theAccordion
level instead of having to set eachAccordion.Panel
'spadding
separately.Should this PR target a new branch instead of
master
since it's a breaking change, or will v6 be the next release (so it doesn't matter)?