Replace "btn-border" with USWDS checkbox and radio#5279
Conversation
There was a problem hiding this comment.
WDYT of adding a newline?
| <label class="usa-radio__label"><%= t('two_factor_authentication.otp_delivery_preference.voice') %> | |
| <label class="usa-radio__label"> | |
| <%= t('two_factor_authentication.otp_delivery_preference.voice') %> |
There was a problem hiding this comment.
This is one of the rare, unfortunate cases where whitespace matters in HTML. The newline collapses down to a single space, which throws off the layout.
I'd definitely agree it would hopefully be something we shouldn't need to worry about. I'm thinking about a few ways we could address this:
- Try to control whitespace behavior with CSS styling
- Use utilities like
label_tag, etc. and avoid writing out the markup
There was a problem hiding this comment.
I think CSS styling would be ideal, or maybe we go with a comment approach
| <label class="usa-radio__label"><%= t('two_factor_authentication.otp_delivery_preference.voice') %> | |
| <label class="usa-radio__label"><!-- can't have leading whitespace | |
| --><%= t('two_factor_authentication.otp_delivery_preference.voice') %> |
There was a problem hiding this comment.
Follow-up at uswds/uswds#4286. Still on the fence for how to handle it in the short-term.
There was a problem hiding this comment.
@anniehirshman-gsa Good question. I would be fine with updating this in the design system. Might be worth a check with Chanan if it'd have any impact on her work on the upcoming partners site.
@aduth confirming that the larger text size (1.125 rem) is approved on the UX side for tiled radio buttons and checkboxes, and I've updated Figma. Figma also reflects the larger padding that would be great to update as well.
There was a problem hiding this comment.
Thanks @anniehirshman-gsa . I've got a small conundrum to sort out with the whitespace improvements from this thread, but otherwise my plan will be to incorporate those changes as a temporary patch into the design system. I can make the tile font size changes around the same time. Since all this is non-ticketed refactoring, I might be a bit delayed in getting to it for prioritization's sake.
There was a problem hiding this comment.
If we want to merge this sooner rather than later, I think it might be nice to leave the commented version of the newline, and then we could leave in a "fix after USDWS update" in there too so we can find them easily if/when USWDS is handled to be more tolerant of whitespace
There was a problem hiding this comment.
did one of the linters move the text up?
There was a problem hiding this comment.
is the for here needed for CSS or is it just for accessibility best practices?
There was a problem hiding this comment.
is the
forhere needed for CSS or is it just for accessibility best practices?
It's needed both for accessibility and also to maintain the behavior that clicking the label should toggle the checkbox.
Previously we were relying on implicit label association by using the label to wrap both the input and label text. That's not an option for the design system checkboxes.
There was a problem hiding this comment.
Screenshots and checkboxes are looking good!
For the tiled radio groups: the IdP uses a slightly larger size for the blue text/label that I'd like to retain for emphasis, even though I know it's not in the design system right now. (I used 1.125 rem aka h3 size in the Public Sans update.) Any suggestions on the best way to implement that? Also looping in @nickttng for opinions if you have
Should it be IdP-specific, or would it make sense to update it in the design system? |
All of the examples I know of in the IdP have the larger text size, so I would be fine with updating this in the design system. @nickttng do you think we should go ahead and make this change in the design system, keep it IdP-specific, throw it out to the wider group for discussion? |
|
@anniehirshman-gsa Good question. I would be fine with updating this in the design system. Might be worth a check with Chanan if it'd have any impact on her work on the upcoming partners site. |
e519dc7 to
7bb7c7b
Compare
|
I rebased the branch to resolve conflicts and updated screenshots in the original comment to reflect pending changes from upcoming A couple things to complete before this is ready:
|
**Why**: Because it's unused and is an ongoing maintenance burden (e.g. #5279).
* Remove unused service_provider_mfa/new.html.erb **Why**: Because it's unused and is an ongoing maintenance burden (e.g. #5279). * Remove empty directory from ERBLint exclude
a865f70 to
4675a19
Compare
**Why**: - Consistency and alignment toward design system - Semantic correctness in considering checkboxes and radio inputs as inputs, not as buttons - Eliminates now-unused custom styling and JavaScript - Avoids relying on JavaScript for stylistic effects - Simpler implementation in some cases
Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>
Avoid offset layout
47a51d6 to
c6c7e7e
Compare
Rebase error
* Replace "btn-border" with USWDS checkbox **Why**: - Consistency and alignment toward design system - Semantic correctness in considering checkboxes and radio inputs as inputs, not as buttons - Eliminates now-unused custom styling and JavaScript - Avoids relying on JavaScript for stylistic effects - Simpler implementation in some cases * Use constant for Privacy URL Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com> * Omit empty label Avoid offset layout * Simplify radio disabled logic * Replace border-none with border-0 Rebase error Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>
Why:
Implementation Notes:
As of
identity-style-guide@6(incorporated in #5265), we now have access to a set of stylized radio and checkbox inputs, including bordered and tile variations, which can serve in place of the custombtn-borderclass.Screenshots: