From 9ccf652c00457e46eaf46fc4cb8f6d0ee582c5ef Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Fri, 1 Oct 2021 14:32:43 +0200 Subject: Initial commit --- .../assets/scss/bootstrap/_input-group.scss | 193 +++++++++++++++++++++ 1 file changed, 193 insertions(+) create mode 100755 themes/hugo-whisper-theme/assets/scss/bootstrap/_input-group.scss (limited to 'themes/hugo-whisper-theme/assets/scss/bootstrap/_input-group.scss') diff --git a/themes/hugo-whisper-theme/assets/scss/bootstrap/_input-group.scss b/themes/hugo-whisper-theme/assets/scss/bootstrap/_input-group.scss new file mode 100755 index 0000000..ac49f69 --- /dev/null +++ b/themes/hugo-whisper-theme/assets/scss/bootstrap/_input-group.scss @@ -0,0 +1,193 @@ +// stylelint-disable selector-no-qualifying-type + +// +// Base styles +// + +.input-group { + position: relative; + display: flex; + flex-wrap: wrap; // For form validation feedback + align-items: stretch; + width: 100%; + + > .form-control, + > .form-control-plaintext, + > .custom-select, + > .custom-file { + position: relative; // For focus state's z-index + flex: 1 1 auto; + // Add width 1% and flex-basis auto to ensure that button will not wrap out + // the column. Applies to IE Edge+ and Firefox. Chrome does not require this. + width: 1%; + margin-bottom: 0; + + + .form-control, + + .custom-select, + + .custom-file { + margin-left: -$input-border-width; + } + } + + // Bring the "active" form control to the top of surrounding elements + > .form-control:focus, + > .custom-select:focus, + > .custom-file .custom-file-input:focus ~ .custom-file-label { + z-index: 3; + } + + // Bring the custom file input above the label + > .custom-file .custom-file-input:focus { + z-index: 4; + } + + > .form-control, + > .custom-select { + &:not(:last-child) { @include border-right-radius(0); } + &:not(:first-child) { @include border-left-radius(0); } + } + + // Custom file inputs have more complex markup, thus requiring different + // border-radius overrides. + > .custom-file { + display: flex; + align-items: center; + + &:not(:last-child) .custom-file-label, + &:not(:last-child) .custom-file-label::after { @include border-right-radius(0); } + &:not(:first-child) .custom-file-label { @include border-left-radius(0); } + } +} + + +// Prepend and append +// +// While it requires one extra layer of HTML for each, dedicated prepend and +// append elements allow us to 1) be less clever, 2) simplify our selectors, and +// 3) support HTML5 form validation. + +.input-group-prepend, +.input-group-append { + display: flex; + + // Ensure buttons are always above inputs for more visually pleasing borders. + // This isn't needed for `.input-group-text` since it shares the same border-color + // as our inputs. + .btn { + position: relative; + z-index: 2; + + &:focus { + z-index: 3; + } + } + + .btn + .btn, + .btn + .input-group-text, + .input-group-text + .input-group-text, + .input-group-text + .btn { + margin-left: -$input-border-width; + } +} + +.input-group-prepend { margin-right: -$input-border-width; } +.input-group-append { margin-left: -$input-border-width; } + + +// Textual addons +// +// Serves as a catch-all element for any text or radio/checkbox input you wish +// to prepend or append to an input. + +.input-group-text { + display: flex; + align-items: center; + padding: $input-padding-y $input-padding-x; + margin-bottom: 0; // Allow use of