Skip to content

Refactor Radio, CheckboxField and Toggle and make them themeable (#20) #238

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

Merged
merged 2 commits into from
Mar 4, 2021

Conversation

adamkudrna
Copy link
Member

@adamkudrna adamkudrna commented Feb 26, 2021

Here it comes 🎊. What has changed? For these components, basically everything.

  • Form fields layout has been rewritten and extended so all fields are built using the same principles. Their behaviour is unified whether they are used inline or wrapped in Toolbar or in FormLayout.
  • Improve label and help/validation text wrapping in context of FormLayout.
  • Radio, CheckboxField and Toggle have been completely rewritten from the ground up to share the same visual principles and theming options with other form components. Default appearance has been made more generic and unopinionated.
  • Animated transition between checked/unchecked states.
  • Reported visual glitches have been fixed.
  • Form fields theming is now fully documented.
  • Finally, last big portions of aged deprecated code have been removed.

Before

image
image
image
image
image

After

Mind the help text wrapping — fields are now inline:

image
image
image
image

Help texts and validation texts make use of available space in context of FormLayout:

image

Getting back to the original appearance is possible:

image

New / Extended

Validation State Styling

image

Disabled State Styling

image

Closes #20.

…inciples (#20)

Make `FormLayout` row gap adjustable via `--rui-form-layout-row-gap`.
@adamkudrna adamkudrna self-assigned this Feb 26, 2021
@github-actions github-actions bot added the BC Breaking change label Feb 26, 2021
@bedrich-schindler
Copy link
Contributor

I've been trying to go through whole PR, but there are just too many changes in CSS code I have not able to check, otherwise I would have spent hours on that. But I ran it and it works fine as well,.

…m themeable (#20)

Check form fields are now themeable the same way as box form fields.
Custom input styling has been inspired by Bootstrap 5.

Breaking changes in theming API:

`--rui-form-field-filled-*` → `--rui-form-field-box-filled-*`
`--rui-form-field-outline-*` → `--rui-form-field-box-outline-*`
`--rui-form-field-input-*` → `--rui-form-field-box-input-*`
`--rui-form-field-border-*` → `--rui-form-field-box-border-*`
`--rui-form-field-placeholder-color` → `--rui-form-field-box-placeholder-color`
`--rui-form-field-size-*` → `--rui-form-field-box-size-*`
`--rui-form-field-caret-*` → `--rui-form-field-box-select-caret-*`
`--rui-form-field-disabled-select-option-color` → `--rui-form-field-box-select-option-disabled-color`

Changed theme values:

`--rui-link-color`: `#007bff` (actual `--rui-color-note`) → `var(--rui-color-active)` (resolves to `--rui-color-note`)
`--rui-link-hover-color`: `#0056b3` → `var(--rui-color-active-hover)`
`--rui-form-field-warning-default-border-color`: `var(--rui-color-warning-darker)` → `var(--rui-color-warning-dark)`

New theme values:

`--rui-color-active-*`
`--rui-color-on-active`
`--rui-focus-box-shadow`
`--rui-form-field-check-*` + related validation state properties, see the docs
`--rui-form-layout-row-gap`
@adamkudrna adamkudrna merged commit 50547e3 into master Mar 4, 2021
@adamkudrna adamkudrna deleted the bc/20 branch March 4, 2021 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BC Breaking change feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor Radio, Checkbox and Toggle
3 participants