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

feat: forms refactoring #419

Merged
merged 7 commits into from
Nov 13, 2019
Merged

feat: forms refactoring #419

merged 7 commits into from
Nov 13, 2019

Conversation

InnaAtanasova
Copy link
Contributor

@InnaAtanasova InnaAtanasova commented Nov 7, 2019

Description

Refactored:

  • fd-form-label - added --required modifier for styling the *
  • added fd-form-item--horizontal modifier class to display form items inline (horizontally)
  • added fd-form-label--inline-help for form items with inline help
  • refactored interactive states colors to use the theme designer
  • refactored the form-messages to reflect the specs - now we have information, valid, invalid, warning
  • removed fd-form-message--help - BREAKING CHANGE
  • refactored fd-textarea - added interaction states, compact mode
  • refactored fd-radio - added interaction states, cosy and compact mode
  • refactored fd-checkbox - added interaction states, compact mode
  • added fd-form-label--radio, fd-form-label--checkbox and fd-form-label--toggle modifier classes to label

Screenshots

Before:

B5

B4

B3

B2

B1

After:

A7

A6

A5

A4

A3

A8

A2

A1

About tests:
Running locally the following tests failed. They have been updated
Screen Shot 2019-11-07 at 4 51 25 PM

@netlify
Copy link

netlify bot commented Nov 7, 2019

Deploy preview for fundamental-styles ready!

Built with commit 6a90a95

https://deploy-preview-419--fundamental-styles.netlify.com

@@ -15,7 +15,7 @@

> .fd-tile__content {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think those stylings should be even removed. They create false expectations

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This rule is applied only when the fd-tile is child of .docs-component.
The padding is just for the content to look nice and the width is to show the cases when we have very long text and truncation.
We want to be able to see this:
Screen Shot 2019-11-08 at 10 52 21 AM

Without the width we see this:
Screen Shot 2019-11-08 at 10 53 57 AM

src/input.scss Outdated

&:last-child {
margin-bottom: 0.25rem;
}

&::placeholder {
@include fd-reset();
@include fd-var-color("color", $fd-forms-color--placeholder, --fd-color-neutral-4);
Copy link
Contributor

Choose a reason for hiding this comment

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

can we replace the old values with theming parameters?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -6,7 +6,7 @@

@include fd-var-color("color", $fd-color, --fd-color-text-1);
Copy link
Contributor

Choose a reason for hiding this comment

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

can we replace with theming parameters?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@droshev droshev added the Enhancement New feature or request label Nov 7, 2019
@droshev droshev added this to the sprint 23 - Melisandre milestone Nov 7, 2019
@droshev droshev requested a review from trilodge November 8, 2019 00:00
@ChristianKienle
Copy link
Contributor

@InnaAtanasova JFYI: the forms documentation still refers a lot to "form groups". But the form groups have been removed.

&--inline {
float: left;
margin-right: fd-space(4);
&--horizontal {
Copy link
Contributor

Choose a reason for hiding this comment

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

What are the different use cases for --horizontal versus --inline?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

--inline is what we had before for displaying the checkboxes and radio buttons inline.
Screen Shot 2019-11-13 at 2 30 45 PM
This was only the elements go to one line, the label is on another line.

But then we needed to add inline items - label and input inline. This was achieved by using flexbox.
Screen Shot 2019-11-13 at 2 31 06 PM

Stefano is working currently on Forms Layout - there's going to be vertical and horizontal layout.

So, to minimize the breaking changes, we decided to keep the --inline modifier for displaying the checkboxes and radio btns inline, and add --horizontal for displaying the items inline

Copy link
Contributor

@jbadan jbadan left a comment

Choose a reason for hiding this comment

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

I just had a quick question about the need for --horizontal versus --inline but other than that looks great to me! 🚢

@InnaAtanasova
Copy link
Contributor Author

@InnaAtanasova JFYI: the forms documentation still refers a lot to "form groups". But the form groups have been removed.

Thanks for pointing this out. You are absolutely right. We will def improve the documentation.

@InnaAtanasova InnaAtanasova merged commit e4e719c into master Nov 13, 2019
@InnaAtanasova InnaAtanasova deleted the feat/forms-refactoring branch November 13, 2019 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants