-
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): stretch slotted actions to fill its height #9250
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.
comments!
@@ -192,6 +192,10 @@ | |||
@apply flex items-center; | |||
} | |||
|
|||
slot[name="actions-start"] { | |||
block-size: 100%; | |||
} |
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.
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:
calcite-design-system/packages/calcite-components/src/components/list-item/list-item.scss
Line 78 in b069284
items-stretch |
or
calcite-design-system/packages/calcite-components/src/components/list-item/list-item.scss
Lines 190 to 193 in b069284
calcite-action, | |
calcite-handle { | |
@apply self-stretch; | |
} |
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.
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.
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'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.
…m:Esri/calcite-design-system into josercarcamo/6565-stretch-slotted-actions
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. |
How's this one going @josercarcamo? |
@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. |
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. |
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. 💪🏻 |
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. |
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.
Looking good, @josercarcamo! 😎
@@ -147,7 +147,10 @@ | |||
|
|||
.actions-start, | |||
.actions-end { | |||
@apply flex items-center; | |||
@apply flex items-stretch; | |||
* { |
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 think we can skip the *
rule because:
- These slots are specifically for actions, which don't have children.
- Overriding user styles for slotted content should be avoided.
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.
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?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.
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.
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.
Code changes LGTM!
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. |
* 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) ...
Related Issue: #6565
Summary
Made the height of the action item 100% so that it fills its available height.