-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add select--stroke modifier and change to default borderless select #992
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.
@adrianababakanian this looks like a solid start!
I'm curious if you think the padding right of the
select-arrow
should also be reduced or removed
Looking to the figma files for guidance, I think we do want a small amount of right padding yes!
Before I approve or reject this, I have a couple questions:
-
Did you consider the trade-offs of making the stroke a modifier and the unstroked style the new base style? That might be more in keeping with Assembly's additive styling model, but at the cost of a change that might be considered "breaking" (although that's up for debate).
-
Did you consider styling disabled/active states differently for unstroked selects? I wonder, for example, if we should only apply background-color changes to stroked selects.
Thanks for the feedback @samanpwbb !
👍
I didn't consider this, though I do see how making the unstroked style the default would be more in keeping with the additive styling model that you mentioned. Should we move forward with switching the modifier to something like
Great callout. I do think the active state makes sense to keep the same as the stroked select -- i.e., the arrow color becomes darker and font color remains the same. But, we might want to handle the disabled state differently, as it doesn't look great with the current state of this PR given the lack of left padding: I'm not seeing anything explicitly in the style guide for how to handle this case -- do you have any thoughts? |
I am on board – @katydecorah would you be okay with this change? It may require some work to migrate for you.
Ya, maybe something closer to how we do disabled |
👍 Yes, I think that pattern makes sense |
When modifying
@samanpwbb I wonder if it would make sense for the |
For unstroked, definitely. Not sure about stroked - we could go either way.. I know @katydecorah originally modelled these after text inputs, which do not change text color.
What you're seeing is the difference between the active and inactive state. Active state should use Also, looking at your screenshot, I wonder if we should adjust the default select style to use a darker triangle? |
Thanks for the clarifications and continued reviews @samanpwbb ! I updated the default arrow to use the default form color rather than the lighter default form color, so now it's the same as the font color. The active state now also uses Right now the colored stroked selects use an updated font color as well. I like how it creates consistency with how unstroked selects handle color variants, but at the same time I see the value in keeping them modeled after text inputs (which don't change colors). @katydecorah I'd appreciate any thoughts you might have on this! |
@adrianababakanian While I love the way it looks, we should make sure that the font color for text has an accessible contrast ratio. My vote is to optimize for legibility over consistency. I know the Assembly color palette will be updated in v1, so perhaps the font color will soon have improved color contrast that would allow us to successfully update the font color without losing legibility. |
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.
@adrianababakanian this is coming together! Noticed a couple minor issues.
Another thing I noticed, that is also present on previous version: we don't have good [data-assembly-focus-control='visible']
styling for selects. Is this something we could fix? Notice how other form types take on a prominent :focus
style, but selects do not.
Really great point @katydecorah ! I think that makes sense. Optimizing for legibility, I see three potential paths forward:
|
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.
@adrianababakanian this is looking really good. Almost ready to merge. I see two tiny issues:
Default stroked tab state doesn't show double border:
Then, after seeing this work and thinking through your notes about differences between stroked/unstroked selects, and thinking through how we use selects throughout our systems now, here's my recommendation:
- Model unstroked select styling after links: leave default and active coloring as you have it now, and add hover states. This also more closely models how Studio now styles unstroked selects
- Model stroked select styling after text inputs: use default text coloring always, and only apply color variants to border and triangle.
Thanks @samanpwbb ! I think I might have pushed up
, while you had already started reviewing -- let me know if the most recent commit fixes that ☝️ issue! I noticed that in hindsight too. I'll add those recommendations for unstroked/stroked select styling too. |
@samanpwbb this should be ready for your final review!
Per #992 (comment), should be good on this point.
I made these udpates, but kept the default box-shadow on focus. Links don't use box-shadows -- let me know if you think we should keep or remove them for unstroked selects.
✅
This clarification is discussed in the docs for both the default select group and the |
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.
Noticed one small detail, once that's taken care of this should be good to go.
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.
This is great!
I had one other optional thought when playing around with this: should we remove the default border-radius on non-stroked selects? Just to keep the base style a bit more minimal? We'd then apply it to the stroked variant only. I don't think this change is necessary but if you agree with me, might be worth sneaking in.
Thanks @samanpwbb !
Hm, my initial thought was yes, but since we're applying a box-shadow to unstroked selects on focus, I think it might be nice to keep the default border-radius. That way when a default select is focused, the overall effect would be more consistent with the style guide. |
Closes #982
This PR adds the
select--border-0
modifier class to support borderless select elements out-of-the-box. It removes theselect
's default box-shadow and left padding.select--stroke
modifier and updates select elements to be unstroked by default.@samanpwbb for review -- I'm curious if you think the padding right of the
select-arrow
should also be reduced or removed, in which case there would be some additional work to be done here.