Skip to content
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

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

alisonailea
Copy link
Contributor

@alisonailea alisonailea commented Nov 13, 2024

Related Issue: #4012

Summary

Add spacing

Removes pt-0 from .content to allow spacing between the header-content and content.

Before

Screenshot 2024-11-13 at 11 30 49 AM

After

Screenshot 2024-11-13 at 11 30 59 AM

@github-actions github-actions bot added the enhancement Issues tied to a new feature or request. label Nov 13, 2024
@ashetland
Copy link

ashetland commented Nov 13, 2024

Does this address the padding around the content slot or only add a token to the header?
Fixed

@alisonailea alisonailea added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Nov 13, 2024
Copy link

@ashetland ashetland left a 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!

@macandcheese
Copy link
Contributor

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.

@alisonailea
Copy link
Contributor Author

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)

@macandcheese
Copy link
Contributor

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?

@ashetland
Copy link

ashetland commented Nov 14, 2024

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?

@alisonailea
Copy link
Contributor Author

@macandcheese and @ashetland I've updated the PR and removed the header token. I agree this makes more sense

Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor

@macandcheese macandcheese left a 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.

@alisonailea alisonailea force-pushed the astump/4012-accordion-item-spacing branch from 96b8f5b to 1bdf1cc Compare November 16, 2024 04:04
@alisonailea
Copy link
Contributor Author

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.

@macandcheese macandcheese self-requested a review November 18, 2024 18:26
@macandcheese
Copy link
Contributor

Looks good - maybe just a tracking issue for the content space comment. Thanks!

@alisonailea
Copy link
Contributor Author

Looks good - maybe just a tracking issue for the content space comment. Thanks!

#10762

@alisonailea alisonailea added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Nov 18, 2024
@alisonailea alisonailea merged commit b0234f9 into dev Nov 18, 2024
15 checks passed
@alisonailea alisonailea deleted the astump/4012-accordion-item-spacing branch November 18, 2024 20:36
alisonailea added a commit that referenced this pull request Nov 19, 2024
**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">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues tied to a new feature or request. pr ready for visual snapshots Adding this label will run visual snapshot testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants