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

Form updates: Bug fixes, docs update, and validation overhaul #22395

Merged
merged 49 commits into from Jun 15, 2017
Merged

Conversation

mdo
Copy link
Member

@mdo mdo commented Apr 9, 2017


Additional commits addressed the following:

@mdo mdo added this to the v4.0.0-beta milestone Apr 9, 2017
@mdo mdo mentioned this pull request Apr 22, 2017
41 tasks
mdo and others added 4 commits April 22, 2017 11:56
— Previously we weren't including the border-width on the computed height, leading to alignment issues.

— New system utilizes three variables (not ideal, but straightforward) for computing these heights. One for the vertical border, one for the line-height/font-size/padding dance, and one to add those together.

— Updates CSS across forms and custom forms to use new sizing. Special note here: form validation icon sizing uses the inner variables because background-image doesn't bleed into borders unless explicit background-clip.
— Sizing shorthand comes last
— Add height var and put it to use
@mdo mdo mentioned this pull request Jun 7, 2017
@pkozlowski-opensource
Copy link

@mdo just to be clear that I'm reading this PR correctly: doest it meant that from now on styling will be based on internal state of native HTML controls? I'm wondering how this will work with JS frameworks that add their own notations of validation constraints and validity state (ex.: some frameworks will have a "pending" state where async validation is in progress).

If we can't style inputs by simply adding appropriate classes and are forced to interact with native HTML controls validity it might be very difficult to use Bootstrap with frameworks that don't reflect validity state in native HTML controls.

I guess the simple question is: will it be possible to style for valid / invalid state by simply adding appropriate CSS classes? I'm seeing that this PR removes .form-control-success and friends, so getting worried here....

@Francismori7
Copy link

Also, think about server side validation fails.. this pr wasn't well thought out IMO... Needs revisit

@mdo
Copy link
Member Author

mdo commented Jun 10, 2017

@pkozlowski-opensource @Francismori7 I've pushed some changes:

  • Added a new form-validation-state() mixin for generating the class names and styles.
  • Added class fallbacks for :valid and :invalid, .is-valid and .is-invalid.
  • Documented the new styles and fixed some docs examples.

Lemme know how that looks, please!

screen shot 2017-06-10 at 4 37 08 pm

@Francismori7
Copy link

This does look good!

Thumbs up from me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
v4 Beta 1
Shipped
Development

Successfully merging this pull request may close these issues.

None yet

5 participants