-
Notifications
You must be signed in to change notification settings - Fork 76
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
feat(accordion-item): custom header and content spacing tokens #10721
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Visual changes lookin' good!
Do we need this header space token to be public? I'd expect only the main content area to have its padding adjusted in this manner. I think we could solve just by adjusting the existing implementation to not use the public property on the header. |
@macandcheese see Paul's comment here - #4012 (comment) |
Maybe we could confirm? I’m just interpreting that as needing to configure the content area padding without that also affecting the header? |
I may have misread Paul's comment as asking for separate control. The original issue only asked for content slot padding and, reading Paul's comment again, I agree with Adam's assessment. This would generally match what we're doing elsewhere, right? |
@macandcheese and @ashetland I've updated the PR and removed the header token. I agree this makes more sense |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still applying to the .header-content
div, at line 78:
.header-content,
.content {
padding: var(
--calcite-accordion-item-content-space,
var(
--calcite-internal-accordion-item-padding,
var(--calcite-internal-accordion-item-spacing-unit, theme("spacing.2") 0.75rem)
)
);
}
That div should just use the --calcite-internal-accordion-item-padding
and not the public one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is currently using the public property on /dev. Are you saying that should not have the same padding as the content?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah - the issue in the original issue is that changing the content also affects the header. All the other instances where we have a "content-padding" or equivalent property, it just affects the content area. Here I'd expect the heading padding to remain unchanged when a user adjusts the "content-space" property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the .header-content
needs to be separated from .content
to ensure the public css property doesn't apply.
I think we should also mark this as a breaking change (or at least visual change). Users can of course retain the previous design by using the public css property and it's minor but just for logging purposes.
96b8f5b
to
1bdf1cc
Compare
There were some weird merge conflicts with /dev so I cleaned up the PR to only include the removal of the 0px top padding as was requested in the original issue. If we want to separate the header and content padding that should be a separate issue. |
Looks good - maybe just a tracking issue for the content space comment. Thanks! |
|
**Related Issue:** #4012 ## Summary ### Add spacing Removes pt-0 from .content to allow spacing between the header-content and content. #### Before <img width="268" alt="Screenshot 2024-11-13 at 11 30 49 AM" src="https://github.com/user-attachments/assets/aef62811-5a09-43e1-8328-330cb2c46bc2"> #### After <img width="267" alt="Screenshot 2024-11-13 at 11 30 59 AM" src="https://github.com/user-attachments/assets/dd92b276-259e-400b-9fcb-f048b5858426">
Related Issue: #4012
Summary
Add spacing
Removes pt-0 from .content to allow spacing between the header-content and content.
Before
After