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

fix(calcite-button): Make shadow dom button 100% width #9145

Merged
merged 21 commits into from
May 1, 2024

Conversation

josercarcamo
Copy link
Contributor

Related Issue: #8490

Summary

When the host element button is set to "full" the shadow dom button is set to 100% width to span the entire space.

@josercarcamo josercarcamo requested a review from a team as a code owner April 17, 2024 21:07
@github-actions github-actions bot added the bug Bug reports for broken functionality. Issues should include a reproduction of the bug. label Apr 17, 2024
:host([scale="l"][width="full"]) button:not(.content--slotted),
:host([scale="l"][width="full"]) a:not(.content--slotted) {
@apply w-full;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

alternative approach

:host(:is([scale="s"], [scale="m"], [scale="l"])[width="full"]) {
  a, button {
    &:not(.content--slotted) {
      inline-size: var(--calcite-container-size-content-fluid);
    }
  }
}

Copy link
Member

Choose a reason for hiding this comment

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

Another alternative approach would be to apply a class here using JS since the CSS logic is getting a little complex here.

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.

Code looks good! @josercarcamo is this fix captured in a screenshot test? If not can we add one?

@driskull driskull added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Apr 30, 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 1, 2024
@josercarcamo josercarcamo merged commit dd61b7f into main May 1, 2024
16 checks passed
@josercarcamo josercarcamo deleted the josercarcamo/8490-calcite-button-shadow-dom branch May 1, 2024 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports for broken functionality. Issues should include a reproduction of the bug. 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.

4 participants