-
Notifications
You must be signed in to change notification settings - Fork 44
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
"Dropdown" component - CSS cleanup (02) #202
"Dropdown" component - CSS cleanup (02) #202
Conversation
…e text (the reason is that the parent has position absolute so no intrinsic width)
…classes (it was not only duplicating the import of CSS classes, but also coming after the components CSS, so resetting margin/padding applied to text elements)
(to avoid having two distinct places where this size is declared)
|
This pull request is being automatically deployed with Vercel (learn more). hds-flight-website – ./🔍 Inspect: https://vercel.com/hashicorp/hds-flight-website/BQDnGaxv2Z1yMey45jQApdaJqJqm hds-components – ./🔍 Inspect: https://vercel.com/hashicorp/hds-components/GE8iCbtvLgSa6cMDanpesTU6qqZg |
…n' into dropdown/02-CSS-cleanup
packages/components/addon/components/hds/dropdown/toggle-icon.hbs
Outdated
Show resolved
Hide resolved
@@ -113,33 +118,32 @@ | |||
box-shadow: var(--token-surface-high-box-shadow); | |||
list-style: none; | |||
margin: 0; | |||
max-width: 25rem; | |||
min-width: 12.5rem; | |||
max-width: 400px; |
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.
[issue] [a11y] these need to be in relative units to support browser zoom.
The most important reason for using responsive and unitless values in our CSS is for supporting our users that rely on zooming. If you read the Web Content Accessibility Guidelines, our users need to be able to zoom the viewport without loss of content or functionality, or restrictions imposed by CSS values or viewport scaling settings.
In particular, there are a some success criteria to be met:
- WCAG 1.4.4: Users must be able to resize text without assistive technology up to 200 percent, without loss of content or functionality. (Level AA)
- WCAG 1.4.10: Users must be able to resize text without being forced to scroll both horizontally and vertically to read that content. (Level AA)
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.
@MelSumner can you tell me how declaring the size in px
or rem
would change the outcome in this case (zooming, not changing base font size, which is something we're not able to support yet)?
This is the content at 200% with px
This is the content at 200% with rem
They look exactly the same to me.
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.
As per @Dhaulagiri comment I've opened a distinct issue to discuss this, so we are not blocked in the merging of the other PRs.
#228
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.
two small issues, everything else seems correct, although I'm not sure why we're using helper classes? I thought the helper classes were for our users, not us.
Co-authored-by: Melanie Sumner <melanie@hashicorp.com>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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 going to approve this to unblock the pipeline of PRs that are open, but let's discuss the pixel/rem question and document our decision so we can refer to that in the future.
📌 Summary
Some minor cleanup/refactoring of the CSS for the
Dropdown
component.🛠️ Detailed description
px
and not inrem
width: max-content
to the list so that it doesn’t compress the texttoggle-icon
👀 How to review
👉 Review commit-by-commit
Reviewer's checklist:
💬 Please consider using conventional comments when reviewing this PR.