From 2d8f42d83d2f17a9b9a7f37b01f7711194d313a5 Mon Sep 17 00:00:00 2001 From: Adam Kudrna Date: Wed, 10 May 2023 14:29:44 +0200 Subject: [PATCH] Bring back sizes mistakenly removed from `InputGroup` to fix label alignment in horizontal layout --- src/lib/components/InputGroup/InputGroup.scss | 14 ++++++++++++++ .../tools/form-fields/_box-field-sizes.scss | 19 +++++++++++-------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/lib/components/InputGroup/InputGroup.scss b/src/lib/components/InputGroup/InputGroup.scss index 7f259201..8201d7f9 100644 --- a/src/lib/components/InputGroup/InputGroup.scss +++ b/src/lib/components/InputGroup/InputGroup.scss @@ -4,6 +4,7 @@ @use "../../styles/tools/form-fields/box-field-elements"; @use "../../styles/tools/form-fields/box-field-layout"; +@use "../../styles/tools/form-fields/box-field-sizes"; @use "../../styles/tools/form-fields/foundation"; @use "../../styles/tools/form-fields/variants"; @use "../../styles/tools/accessibility"; @@ -65,3 +66,16 @@ .isRootInFormLayout { @include box-field-layout.in-form-layout(); } + +// Sizes +.isRootSizeSmall { + @include box-field-sizes.size(small, $has-input: false); +} + +.isRootSizeMedium { + @include box-field-sizes.size(medium, $has-input: false); +} + +.isRootSizeLarge { + @include box-field-sizes.size(large, $has-input: false); +} diff --git a/src/lib/styles/tools/form-fields/_box-field-sizes.scss b/src/lib/styles/tools/form-fields/_box-field-sizes.scss index 8016db2b..4049d9ff 100644 --- a/src/lib/styles/tools/form-fields/_box-field-sizes.scss +++ b/src/lib/styles/tools/form-fields/_box-field-sizes.scss @@ -1,19 +1,22 @@ @use "sass:map"; @use "../../theme/form-fields" as theme; -@mixin size($size, $is-multiline: false) { +@mixin size($size, $has-input: true, $is-multiline: false) { $size-properties: map.get(theme.$box-sizes, $size); --rui-local-padding-y: #{map.get($size-properties, padding-y)}; --rui-local-padding-x: #{map.get($size-properties, padding-x)}; - --rui-local-font-size: #{map.get($size-properties, font-size)}; - .input { - @if $is-multiline { - height: auto; - min-height: map.get($size-properties, height); - } @else { - --rui-local-height: #{map.get($size-properties, height)}; + @if $has-input { + --rui-local-font-size: #{map.get($size-properties, font-size)}; + + .input { + @if $is-multiline { + height: auto; + min-height: map.get($size-properties, height); + } @else { + --rui-local-height: #{map.get($size-properties, height)}; + } } } }