Skip to content
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

fix(styles): fix overflow styling on Radio Group and Checkbox and align styles with Pattern Library #1110

Merged
merged 26 commits into from
Jul 21, 2023

Conversation

yhafez
Copy link
Contributor

@yhafez yhafez commented Jul 16, 2023

Closes #627
Relates to #949
Relates to #1034

Relates to Walnut #5739

Current behavior:
https://github.com/dequelabs/cauldron/assets/60084578/b94f6133-0c7c-4368-9277-6736618301f9


With .Checkbox, .Radio flexwrap changed to nowrap:
https://github.com/dequelabs/cauldron/assets/60084578/ee399c8d-88c7-4b37-be61-2e2b4403bb21
no align-item self

w/ 4th option under wrapping line:
https://github.com/dequelabs/cauldron/assets/60084578/4dbaa581-63a3-41e5-9a02-d0033e09c6e0


With .Checkbox, .Radio flexwrap changed to nowrap and .Radio__overlay given align-self of flex-start (implemented):
https://github.com/dequelabs/cauldron/assets/60084578/6142d258-e011-451f-9427-bff88b6bcee9
align-item self

w/ 4th option under wrapping line:
https://github.com/dequelabs/cauldron/assets/60084578/fbe68121-6973-4831-af4b-12316976020d

@yhafez yhafez requested a review from a team as a code owner July 16, 2023 15:44
@github-actions
Copy link
Contributor

Preview branch generated at https://radio-group-wrap.d1gko6en628vir.amplifyapp.com

Copy link
Member

@scurker scurker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checkbox/radio share styles, we cannot make a change to one without changing both, see below screenshot:

cauldron checkbox with description to the left of the checkbox label and checkbox

@yhafez
Copy link
Contributor Author

yhafez commented Jul 17, 2023

Checkbox/radio share styles, we cannot make a change to one without changing both, see below screenshot:

cauldron checkbox with description to the left of the checkbox label and checkbox

Addressed!

@yhafez yhafez changed the title fix: fix overflow styling on Radio Group fix: fix overflow styling on Radio Group and Checkbox Jul 17, 2023
@scurker scurker changed the title fix: fix overflow styling on Radio Group and Checkbox fix(styles): fix overflow styling on Radio Group and Checkbox Jul 17, 2023
@scurker
Copy link
Member

scurker commented Jul 17, 2023

After a quick zoom meeting with @yhafez and @dequelabs/cauldron-design, we settled on the following:

@yhafez yhafez changed the title fix(styles): fix overflow styling on Radio Group and Checkbox fix(styles): fix overflow styling on Radio Group and Checkbox and align styles with Pattern Library Jul 19, 2023
@yhafez yhafez requested a review from scurker July 20, 2023 14:38
Copy link
Member

@scurker scurker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work! Just a few nits to fix.

packages/styles/forms.css Outdated Show resolved Hide resolved
packages/styles/forms.css Outdated Show resolved Hide resolved
packages/styles/forms.css Outdated Show resolved Hide resolved
packages/styles/forms.css Outdated Show resolved Hide resolved
packages/styles/forms.css Outdated Show resolved Hide resolved
packages/styles/forms.css Outdated Show resolved Hide resolved
packages/styles/forms.css Outdated Show resolved Hide resolved
packages/styles/forms.css Outdated Show resolved Hide resolved
@scurker
Copy link
Member

scurker commented Jul 20, 2023

Update from @dequelabs/cauldron-design

There should be a global var accent-primary-disabled set to #78a6d8 as we will be using it elsewhere.

yhafez and others added 2 commits July 20, 2023 22:07
Co-authored-by: Jason <jason@scurker.com>
Co-authored-by: Jason <jason@scurker.com>
@bobbyomari
Copy link
Contributor

@yhafez here are my observations...

checkbox dark theme:

  • the active fill on touch down should be accent-light @ 25% opacity
  • the active fill on touch down in error state should be accent-danger @ 25% opacity
  • the .Field_labelDescription should be color accent-light
  • Set margin-top: var(--space-smallest); for .error on checkbox with description. I think it strikes a better visual balance with how the code is structured (see attached screenshots, the one with more spacing is 8px). Looks fine with what it's at on
  • If label is being used with checkboxes, can we set the field margin-bottom to var(--space-smallest)? This also comes to play with radios.

checkbox light theme:

  • the active fill on touch down should be accent-primary @ 25% opacity
  • the active fill on touch down in error state should be error @ 25% opacity
  • same as dark theme... set margin-top: var(--space-smallest); for .error on checkbox with description

radio dark theme:

  • it appears the radio focus is not circular, it's a rectangle
  • .Field_label padding-bottom should be var(--space-smallest)
  • related to above: should we use margin-bottom instead of padding-bottom?
  • like dark checkboxes, the active fill on touch down should be the same
  • on inline layout, remove margin-bottom from .Radio_wrap

radio light theme:

  • same radio focus issue as dark theme
  • same .Field_label request as dark theme
  • like light checkboxes, the active fill on touch down should be the same
  • same inline layout margin-bottom change as dark theme radios

current implementation with margin-top: 4px;

image

updated implementation with margin-top: 8px;

image

@bobbyomari
Copy link
Contributor

I already sent these changes to @yhafez but wanted to document them here as well for a 2nd PR review...

Checkboxes

  • I noticed on the error state, when the checkbox is empty, the active fill is correct, but when the error checkbox is checked, the active fill stays red. Is there way to make this change to red active fill only when the checkbox is unchecked and in an error state? This applies to light and dark theme.

Radios

  • The label for "do you like pizzas?" is now no longer font-weight: 500;
  • Some discrepancies between Cauldron in UXPin vs development...
    -- The space between the radio label and description should be var(--space-half);
    -- The space between radio groups should be var(--space-small);
    -- This helps create some better visual balance between what description belongs to what radio field. Below are screenshots to share what that change looks like.

Radio with long description

image

Radio with short description

image

@yhafez yhafez requested a review from a team as a code owner July 21, 2023 11:57
Copy link
Member

@scurker scurker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Just a last few code changes needed.

docs/pages/components/Checkbox.mdx Outdated Show resolved Hide resolved
packages/styles/forms.css Outdated Show resolved Hide resolved
packages/styles/forms.css Outdated Show resolved Hide resolved
packages/styles/forms.css Outdated Show resolved Hide resolved
Copy link
Member

@scurker scurker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM, 2 questions. Let's get @dequelabs/cauldron-design to give a thumbs up too.

packages/styles/forms.css Outdated Show resolved Hide resolved
packages/styles/forms.css Show resolved Hide resolved
Copy link
Member

@scurker scurker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work @yhafez!

@yhafez yhafez merged commit 4f8a9ba into develop Jul 21, 2023
2 checks passed
@yhafez yhafez deleted the radio-group-wrap branch July 21, 2023 18:16
@github-actions
Copy link
Contributor

Preview branch generated at https://radio-group-wrap.d1gko6en628vir.amplifyapp.com

Comment on lines +185 to +191
border-top: 1px solid var(--field-error-border-color);
text-align: left;
font-size: var(--text-size-smallest);
font-weight: var(--font-weight-normal);
padding-left: var(--space-half);
font-size: var(--text-size-smallest);
margin-top: var(--space-half);
margin-left: calc(var(--icon-size) + 2px + var(--space-half));
padding: var(--space-half) 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yhafez This is the change that is doing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sync RadioGroup radio items with UXPin Sync checkboxes with UXpin Checkbox wrapping issue
4 participants