-
Notifications
You must be signed in to change notification settings - Fork 17
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
LG-4791: Add Process List component styles #279
Conversation
Account for changes in #274, since otherwise replacement won't occur, and pa11y will be testing against the live site.
Visual regression build failure is because we're adding new content, so the changed navigation is flagged. |
@aduth i like the look of the process list. comparing it to the one on the get started page, can you confirm the color of the vertical connectors? yours looks a hair darker, which i like. obviously once implemented we can swap whatever is being used on the site for the design system. i also like the two sizes. lgtm |
It's using the |
Overall, it looks to be in the right direction. Regarding the default and connected lists: While the white item number on Any thoughts/concerns? Should we consider darkening the background to Update: With this APCA tool, the white text on |
What's the possibility of a team member reusing the code snippet with the default |
@nickttng great point. I didn't think about AAA contrast on a smaller circle/number. here is a screenshot using primary-dark / #205493 for comparison. |
yep- that is correct. it might be my ole eyes 😂 |
Happy to make a change here. The numbers are bolded (700 weight) and 1rem (16px) for the default styling, 1.5rem (24px) for the large size, so passing WCAG 2 AA minimums for both with current default and large sizing, and failing WCAG 2 AAA minimum for default size, still passing for large size. Based on the WCAG 3 tool you linked, it would be a Score 5 (max) for both. Based on that, I might say it's fine as-is if we'd want? But more contrast couldn't hurt either.
The code snippets were copied verbatim from the USWDS documentation, but yes, it would need to be adapted to the specific implementation to make sure the heading levels increment in the correct order. This is also something I expect would (should) be caught by automated tests as well. The font sizes are explicitly assigned, so it should appear visually identical regardless which level is used. That being said, the USWDS documentation does include an extra snippet of advice to this point:
Maybe we could include a short preamble warning about this, similar to the note we include in the Accordion documentation? Then again, it feels a bit strange to cherry-pick which guidance to include, vs. featuring the base documentation more prominently or copying all of it into our documentation. |
Let's update to
Good point. I flagged about the semantic headings because historically, it has been an issue that's overlooked in the implementation. Alternatively, I wonder if the language of the "View USWDS component" URL could be more clear, like "View USWDS component for guidance" (adding "for guidance"). |
Because it's rather unreliable, should ideally not be needed (rely on default vertical centering), and can vary (have adverse effect) depending on screen resolution.
So that it's clearer there is additional documentation that a developer should reference when using a component. See: #279 (comment)
Cool, done in ce0f5a6.
I like that idea. I added it in f392e10. Both of these changes should be reflected in the live preview link shortly. |
Yeah, I did notice this. I had actually put some "nudge" styling in place originally, then decided to revert it in 20b09bf. I noticed that it differs depending on the resolution of the display, because the nudge caused an offset when I was looking at the preview on my phone. Since the default styling is actually centered, I think it's probably a sub-pixel rounding issue. There might be some other adjustments we could try to make this a bit more consistent (e.g. font size, circle size, etc). |
Narrower connector
I narrowed the connector slightly (8px to 5px) for the default (non-"big") process list based on this discussion in Slack (cc @anniehirshman-gsa), which can be seen in the live preview. Are there any other revisions we'd like to make here? |
No other revisions. Do we want to figure out the vertical center issue in this PR? Or follow up another time? |
I took another look at this on Friday and again this morning, which was quite a rabbit hole of font metrics and the like 😅 I had trouble coming up with a solution that could work universally, since the font rendering seems to vary depending on the browser. At least on my browser (mac OS Chrome), the default rendering of a "3" is vertically off-center here: https://codepen.io/aduth/pen/zYPOpLG Interestingly though, on my phone, the current live preview of this branch is centered. If anything, it might be more below center: So the problem with adding styles to push down a pixel or two is that it would look even further off-center in these other browsers. To my previous point about adjusting font-sizes or circle sizes, the centering does seem a bit better with a
Future CSS support for a
The only other thought I might have is to try to avoid using text altogether, rendering the number as a (svg) image, which wouldn't have the same issues with font spacing. The problem with this is that we'd need to embed redundant images for Public Sans font characters, and we would have to override the counter increment behavior which is otherwise provided to us natively through tl;dr I might suggest we leave it for another time? Unless you think any of these ideas are especially worth following-up on. |
This is quite a rabbit hole. 🕳️ Appreciate you for investigating. Except for the potential future CSS support, I don't think any is worth the workaround for something that is minor and browser-based. Let's leave it for another time. 👍🏼 |
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.
🚀
Base styling is smaller and excludes the connector otherwise shown with the base USWDS Process List component.
A "connected" (
.usa-process-list--connected
) variant restores the connector.A "big" (
.usa-process-list--big
) variant increases the size of the numbered circle.They can also be used in combination with the other.
Live preview URL: https://federalist-2f194a10-945e-4413-be01-46ca6dae5358.app.cloud.gov/preview/18f/identity-style-guide/aduth-process-list/components/process-list/