-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Select] consolidate se23 styles #10081
Conversation
@@ -1,5 +1,5 @@ | |||
@function control-height() { | |||
@return 36px; | |||
@return 32px; |
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.
Value ends up being used in TextField
, Select
and ResourceList
. The first two override the value to be 32px
with the feature flag enabled so they are not affected by this change.
The third, ResourceList, doesn't override this style. However it appears its being used as a min-height value, and (from what I can see) doesn't result in any visual change to the ResourceList component.
Additionally, insofar as the logic described in the following issue around variable heights. It would appear that Select leverages line-height
and font-size
to enforce a height of 32px
on larger screens and 36px
on smaller ones. So defaulting the min-height
specified in the control-height
mixin to the minimum of 32px
appears to be the right thing to do. At least until we address / resolve the behaviour outlined in the above linked issue. (cc @jesstelford)
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.
hmm now the focus ring isn't working for any of the selects :( https://5d559397bae39100201eedc1-sxmaeqinrc.chromatic.com/?path=/story/all-components-select--all maybe this commit? |
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.
Looks good! Just noticed the same issue @sophschneider pointed out about the focus ring missing.
Fixed, deleted what I thought was a duplicate selector, reverted the change 👍 |
2f75ee9
to
1b13fbf
Compare
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY | ||
@include focus-ring($style: 'focused'); | ||
|
||
#{$se23} & { |
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.
Interesting that there's not a @include no-focus-ring;
to remove here. At first I though that meant the @include focus-ring($style: 'focused');
should remain, but looking at the later code, a more specific selector which does include @include no-focus-ring;
wins:
.error .Input:focus-visible ~ .Backdrop {
@include focus-ring($style: 'focused');
}
/* vs ... */
html[class~="Polaris-Summer-Editions-2023"] .Input:focus-visible ~ .Backdrop {
@include focus-ring($style: 'focused');
@include no-focus-ring; /* <--- WINNER */
}
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.
Oooft, control-height()
strikes again!
I think your change is a good one, but I also think it leads to some other changes we should be making...
The se23
styles were modified like:
min-height: control-height();
+ #{$se23} & {
+ min-height: 32px;
+ }
Which I think is because control-height() == 36px
even in se23. Semantically, we still want those min-heights to match the control height, but the control-height()
function was outdated, so hard coding a pixel value was easier (eg; in Select)
Now that your PR has updated control-height()
, I think we should replace the hard coded values with the semantically correct function call in Option, TextField, and Select.
Note that Breadcrumbs looks, at first glance, to use a different value (min-height: 28px
), throwing a spanner in the works. But I'm pretty certain that code will fully go away (the .Breadcrumb
class isn't used in summer editions), so we can skip that one 👍
@jesstelford I've already made that change in Let me know if I've misinterpreted the ask here 👍 |
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.
Agreed! Let's do it in a seperate PR 🚢
<!-- ☝️How to write a good PR title: - Prefix it with [ComponentName] (if applicable), for example: [Button] - Start with a verb, for example: Add, Delete, Improve, Fix… - Give as much context as necessary and as little as possible - Prefix it with [WIP] while it’s a work in progress --> ### WHY are these changes introduced? Fixes #9963 <!-- Context about the problem that’s being addressed. --> ### WHAT is this pull request doing? <!-- Summary of the changes committed. Before / after screenshots are appreciated for UI changes. Make sure to include alt text that describes the screenshot. If you include an animated gif showing your change, wrapping it in a details tag is recommended. Gifs usually autoplay, which can cause accessibility issues for people reviewing your PR: <details> <summary>Summary of your gif(s)</summary> <img src="..." alt="Description of what the gif shows"> </details> --> <!-- ℹ️ Delete the following for small / trivial changes --> - Change control-height to be 32px - `Select` consolidate se23 styles ### How to 🎩 * [Storybook](https://5d559397bae39100201eedc1-oiuqenxfoy.chromatic.com/?path=/story/all-components-select--all) * [Prod storybook](https://storybook.polaris.shopify.com/?path=/story/all-components-select--all) ### 🎩 checklist - [ ] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [ ] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [ ] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) - [ ] Updated the component's `README.md` with documentation changes - [ ] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide
<!-- ☝️How to write a good PR title: - Prefix it with [ComponentName] (if applicable), for example: [Button] - Start with a verb, for example: Add, Delete, Improve, Fix… - Give as much context as necessary and as little as possible - Prefix it with [WIP] while it’s a work in progress --> ### WHY are these changes introduced? Fixes Shopify#9963 <!-- Context about the problem that’s being addressed. --> ### WHAT is this pull request doing? <!-- Summary of the changes committed. Before / after screenshots are appreciated for UI changes. Make sure to include alt text that describes the screenshot. If you include an animated gif showing your change, wrapping it in a details tag is recommended. Gifs usually autoplay, which can cause accessibility issues for people reviewing your PR: <details> <summary>Summary of your gif(s)</summary> <img src="..." alt="Description of what the gif shows"> </details> --> <!-- ℹ️ Delete the following for small / trivial changes --> - Change control-height to be 32px - `Select` consolidate se23 styles ### How to 🎩 * [Storybook](https://5d559397bae39100201eedc1-oiuqenxfoy.chromatic.com/?path=/story/all-components-select--all) * [Prod storybook](https://storybook.polaris.shopify.com/?path=/story/all-components-select--all) ### 🎩 checklist - [ ] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [ ] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [ ] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) - [ ] Updated the component's `README.md` with documentation changes - [ ] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide
WHY are these changes introduced?
Fixes #9963
WHAT is this pull request doing?
Select
consolidate se23 stylesHow to 🎩
🎩 checklist
README.md
with documentation changes