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

Use display helper consistently for all components #2114

Merged
merged 7 commits into from
May 16, 2024

Conversation

rajsite
Copy link
Member

@rajsite rajsite commented May 15, 2024

Pull Request

🤨 Rationale

This PR updates all defined components to use a custom version of the display helper. The goal of this PR is to be a refactor to use the same helper but should be effectively a no-op.

Part of #1326

👩‍💻 Implementation

  • Added a custom display helper
  • Updated all elements to use it
  • Updates elements that were missing it to have one with a value that reflects what shows up in storybook today as the computed display value
    • Utility elements that should never be visible / have visible content were set to display: none;

🧪 Testing

Rely on storybook to verify nothing changed.

✅ Checklist

  • I have updated the project documentation to reflect my changes or determined no changes are needed. Updated the display doc topic.

@rajsite rajsite marked this pull request as ready for review May 15, 2024 23:58
@rajsite rajsite mentioned this pull request May 15, 2024
2 tasks
Copy link
Contributor

@jattasNI jattasNI 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 look good but I'm curious about the turbo snap behavior so I'll wait to approve.

@rajsite rajsite requested a review from fredvisser as a code owner May 16, 2024 17:53
@rajsite rajsite requested a review from jattasNI May 16, 2024 18:14
@rajsite rajsite enabled auto-merge (squash) May 16, 2024 18:14
@rajsite rajsite merged commit 17ddea5 into main May 16, 2024
13 checks passed
@rajsite rajsite deleted the consistent-display-helper branch May 16, 2024 18:30
@rajsite rajsite mentioned this pull request Jun 10, 2024
1 task
rajsite added a commit that referenced this pull request Jun 10, 2024
# Pull Request

## 🤨 Rationale

Switch to using `box-sizing: border-box;` consistently in all our
components.

## 👩‍💻 Implementation

- Each component should use the `display` helper when defined which was
made consistent in #2114. This PR leverages that helper to make sure
each component sets the elements in the shadow root to use `box-sizing:
border-box;` consistently
- Created separate selectors for targeting all children, i.e. `* {}`,
the host itself, i.e. `:host {}`, and all before and after
pseduo-elements so devtools stays clearer, specifically the selector for
`:host` and the selector for `*` are clear in dev tools without the
noise of the `::before` and `::after` selectors
- Cleared the manual configuration for `box-sizing`
- Cleaned up some padding configurations (now consistently included in
the size inside the border) to be margin configurations (which are
outside the border and not part of the size).

## 🧪 Testing

Rely on chromatic, explanation of some of the changes:
- Menu changes look correct, the minimum size now includes the border
instead of the border going outside the configured size
- Select filter box changes look improved. The sizing of the filter box
and the no options box now fit the control height instead of being
larger than the control height
- Rich text changes look innocuous. Added the interaction design figma
we have but don't think there are strict visual design docs to
reference.

## ✅ Checklist

- [x] I have updated the project documentation to reflect my changes or
determined no changes are needed.
@rajsite rajsite mentioned this pull request Jun 10, 2024
1 task
rajsite added a commit that referenced this pull request Jun 11, 2024
# Pull Request

## 🤨 Rationale

Switch to using `box-sizing: border-box;` consistently in all our
components.
fixes #1326

## 👩‍💻 Implementation

- Each component should use the `display` helper when defined which was
made consistent in #2114. This PR leverages that helper to make sure
each component sets the elements in the shadow root to use `box-sizing:
border-box;` consistently
- Created separate selectors for targeting all children, i.e. `* {}`,
the host itself, i.e. `:host {}`, and all before and after
pseduo-elements so devtools stays clearer, specifically the selector for
`:host` and the selector for `*` are clear in dev tools without the
noise of the `::before` and `::after` selectors
- Cleared the manual configuration for `box-sizing`
- Cleaned up some padding configurations (now consistently included in
the size inside the border) to be margin configurations (which are
outside the border and not part of the size).

## 🧪 Testing

Rely on chromatic, explanation of some of the changes:
- Menu changes look correct, the minimum size now includes the border
instead of the border going outside the configured size
- Select filter box changes look improved. The sizing of the filter box
and the no options box now fit the control height instead of being
larger than the control height
- Rich text changes align with figma (border included in the 40px of the
footer section). Added the interaction design figma to the component
status table but don't think there are strict visual design docs to
reference.
- Recreated the PR from squashed commits so that reviewers can see
Chromatic Test changes more easily.

## ✅ Checklist

- [x] I have updated the project documentation to reflect my changes or
determined no changes are needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants