Skip to content

Commit

Permalink
Bring back sizes mistakenly removed from InputGroup to fix label al…
Browse files Browse the repository at this point in the history
…ignment in horizontal layout
  • Loading branch information
adamkudrna committed May 22, 2023
1 parent cfacdbc commit 2d8f42d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
14 changes: 14 additions & 0 deletions src/lib/components/InputGroup/InputGroup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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);
}
19 changes: 11 additions & 8 deletions src/lib/styles/tools/form-fields/_box-field-sizes.scss
Original file line number Diff line number Diff line change
@@ -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)};
}
}
}
}

0 comments on commit 2d8f42d

Please sign in to comment.