From 07d0be92245ac93193b0f764c50f953a679acbb3 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Tue, 15 Sep 2020 20:31:56 -0700 Subject: [PATCH 01/10] Rewrite input groups --- scss/forms/_input-group.scss | 34 +- site/content/docs/5.0/forms/input-group.md | 383 +++++++++------------ site/content/docs/5.0/migration.md | 11 +- 3 files changed, 194 insertions(+), 234 deletions(-) diff --git a/scss/forms/_input-group.scss b/scss/forms/_input-group.scss index 7a9a14dd7be3..22d3c5fd897c 100644 --- a/scss/forms/_input-group.scss +++ b/scss/forms/_input-group.scss @@ -2,7 +2,9 @@ // Base styles // -.input-group { +// .input-group, +.input-group-start, +.input-group-end { position: relative; display: flex; flex-wrap: wrap; // For form validation feedback @@ -128,13 +130,31 @@ // stylelint-disable-next-line no-duplicate-selectors .input-group { - > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu), - > .dropdown-toggle:nth-last-child(n + 3) { - @include border-right-radius(0); + &-start { + > .input-group-text, + > .btn { + @include border-right-radius(0); + } + + > .form-control, + > .form-select, + > .form-file { + margin-left: -$input-border-width; + @include border-left-radius(0); + } } - > :not(:first-child):not(.dropdown-menu) { - margin-left: -$input-border-width; - @include border-left-radius(0); + &-end { + > .input-group-text, + > .btn { + margin-left: -$input-border-width; + @include border-left-radius(0); + } + + > .form-control, + > .form-select, + > .form-file { + @include border-right-radius(0); + } } } diff --git a/site/content/docs/5.0/forms/input-group.md b/site/content/docs/5.0/forms/input-group.md index 599fdbacde1e..dabc2151e86c 100644 --- a/site/content/docs/5.0/forms/input-group.md +++ b/site/content/docs/5.0/forms/input-group.md @@ -1,264 +1,150 @@ --- layout: docs title: Input group -description: Easily extend form controls by adding text, buttons, or button groups on either side of textual inputs, custom selects, and custom file inputs. +description: Extend form controls by adding text, buttons, or button groups on either side of textual inputs, custom selects, and custom file inputs. group: forms toc: true --- -## Basic example +## Overview -Place one add-on or button on either side of an input. You may also place one on both sides of an input. Remember to place `