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): stretch slotted actions to fill its height #9250

Merged
merged 19 commits into from
Oct 7, 2024

Conversation

josercarcamo
Copy link
Contributor

Related Issue: #6565

Summary

Made the height of the action item 100% so that it fills its available height.

@josercarcamo josercarcamo requested a review from a team as a code owner May 2, 2024 23:17
@github-actions github-actions bot added the enhancement Issues tied to a new feature or request. label May 2, 2024
@josercarcamo josercarcamo added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label May 2, 2024
Copy link
Member

@driskull driskull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments!

@@ -192,6 +192,10 @@
@apply flex items-center;
}

slot[name="actions-start"] {
block-size: 100%;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this working @josercarcamo? Do we need some new screenshot tests to account for these changes?

I would have expected either align-items:stretch or align-self:stretch needs to be used to stretch the items by either using the ::slotted selector or some element within the shadow DOM of the component.

Something like:

or

calcite-action,
calcite-handle {
@apply self-stretch;
}

Copy link
Contributor Author

@josercarcamo josercarcamo May 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is working, at least with manual testing. I tried the "align-items: stretch" but it didn't work in this case. I actually tried to use the solution in alert.scss as shown below, but it didn't work.

.actions-end { @apply flex self-stretch; }

EDIT: Actually, your suggestion led me to a simpler solution. Testing and will push soon.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just wondering why this is doing anything. A slot element is just a placeholder and really isn't an element that needs to be styled.

@driskull driskull requested a review from macandcheese May 3, 2024 16:08
@josercarcamo josercarcamo 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 May 3, 2024
@josercarcamo josercarcamo 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 May 3, 2024
@josercarcamo josercarcamo 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 May 3, 2024
@josercarcamo josercarcamo 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 May 3, 2024
Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions.

@github-actions github-actions bot added the Stale Issues or pull requests that have not had recent activity. label May 11, 2024
@driskull
Copy link
Member

How's this one going @josercarcamo?

@josercarcamo
Copy link
Contributor Author

@driskull as we discussed on teams, I'll pick this up when the September release nears or I'll try to squeeze it in during down time in some other release.

@github-actions github-actions bot removed the Stale Issues or pull requests that have not had recent activity. label May 21, 2024
Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions.

@alisonailea
Copy link
Contributor

I'll pick this up when the September release nears or I'll try to squeeze it in during down time in some other release.

Sorry for accidental churn. I think I missed this discussion. Can we add the September milestone tag to this? @geospatialem

@geospatialem
Copy link
Member

Sorry for accidental churn. I think I missed this discussion. Can we add the September milestone tag to this? @geospatialem

@alisonailea The issue was originally in September, but the above PR was initialized before the milestone started in May. We should be covered for the future work already. 💪🏻

@github-actions github-actions bot removed the Stale Issues or pull requests that have not had recent activity. label Jun 23, 2024
Copy link
Contributor

github-actions bot commented Jul 3, 2024

This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions.

@github-actions github-actions bot added the Stale Issues or pull requests that have not had recent activity. label Jul 3, 2024
@josercarcamo josercarcamo 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 Oct 3, 2024
@github-actions github-actions bot removed the Stale Issues or pull requests that have not had recent activity. label Oct 4, 2024
Copy link
Member

@jcfranco jcfranco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, @josercarcamo! 😎

@@ -147,7 +147,10 @@

.actions-start,
.actions-end {
@apply flex items-center;
@apply flex items-stretch;
* {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can skip the * rule because:

  1. These slots are specifically for actions, which don't have children.
  2. Overriding user styles for slotted content should be avoided.

Copy link
Contributor Author

@josercarcamo josercarcamo Oct 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thing is that

causes all elements below header to have "items-center" so it has to be overridden which is what this line change does. How should we proceed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies! I thought this was targeting the slotted content. 😅

Sidebar: I still think we can tidy this up to avoid having to override the universal selector elsewhere. We should consider swapping out the universal selector for explicit ones in a follow-up PR.

Copy link
Member

@jcfranco jcfranco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes LGTM!

@jcfranco
Copy link
Member

jcfranco commented Oct 7, 2024

I forgot to mention, before installing, could you update the story to ensure it catches any regression if this style is changed or removed? I didn’t notice any difference when I tested by removing it locally and comparing.

@josercarcamo josercarcamo 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 Oct 7, 2024
@josercarcamo josercarcamo merged commit ba46dc4 into dev Oct 7, 2024
13 checks passed
@josercarcamo josercarcamo deleted the josercarcamo/6565-stretch-slotted-actions branch October 7, 2024 17:56
@github-actions github-actions bot added this to the 2.13.1 patch milestone Oct 7, 2024
benelan added a commit that referenced this pull request Oct 7, 2024
* origin/dev: (230 commits)
  chore: release next
  chore(sort-handle): add messages (#10474)
  feat(accordion-item): stretch slotted actions to fill its height (#9250)
  chore: release next
  feat(dialog, modal, popover, input-date-picker,  input-time-picker, sheet): support stacked component sequential closing with escape (#9231)
  chore: remove commented-out code (#10478)
  chore: add cssrem VSCode extension recommendation (#10300)
  docs(accordion-item): fix deprecation tag (#10479)
  chore: release next
  feat(stepper-item): update component's active state background color. (#10475)
  refactor: use `requestAnimationFrame` to replace `readTask` (#10432)
  chore: release next
  fix(tip): fix rendering tied to named-slot content (#10470)
  ci: compile estimate totals per milestone (#10442)
  chore: release next
  fix(modal): fix rendering tied to named-slot content (#10469)
  chore: release next
  fix(shell-center-row): fix rendering tied to named-slot content (#10451)
  fix(inline-editable): fix rendering tied to default slot content (#10456)
  fix(input, input-number, input-text): should not set slotted actions to be disabled (#10458)
  ...
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.

5 participants