From b01e81ed36493fc687250643395e2d5c55b07e28 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sat, 23 Dec 2017 22:47:37 -0800 Subject: [PATCH] Rewrite custom file input - Changes the wrapping label to a div so we can style the label instead of another element while also supporting form validation. - Fixes form validation styles for custom file input (closes #24831). - Updates docs with validation styles (also adding example feedback text while I was there) and new how it works section. --- docs/4.0/components/forms.md | 50 +++++++++++++++++------------------- scss/_custom-forms.scss | 42 ++++++++++++++---------------- scss/_variables.scss | 7 +---- scss/mixins/_forms.scss | 17 ++++++++++-- 4 files changed, 59 insertions(+), 57 deletions(-) diff --git a/docs/4.0/components/forms.md b/docs/4.0/components/forms.md index c69bfe2ae2..e5a568b67b 100644 --- a/docs/4.0/components/forms.md +++ b/docs/4.0/components/forms.md @@ -899,31 +899,37 @@ Our example forms show native textual ``s above, but form validation styl {% example html %}
-
+
+
Example invalid feedback text
-
+
+
More example invalid feedback text
- +
+ +
Example invalid custom select feedback
+
- +
+ + +
Example invalid custom file feedback
+
{% endexample %} @@ -1062,24 +1068,16 @@ As is the `size` attribute: ### File browser -The file input is the most gnarly of the bunch and require additional JavaScript if you'd like to hook them up with functional *Choose file...* and selected file name text. +The file input is the most gnarly of the bunch and requires additional JavaScript if you'd like to hook them up with functional *Choose file...* and selected file name text. {% example html %} - +
+ + +
{% endexample %} -Here's how it works: - -- We wrap the `` in a `