Skip to content

Commit 3cbef3a

Browse files
committed
fix(textarea): make sure line height is the same for input and textarea and reflects the design in the ui kit
1 parent 3c74c64 commit 3cbef3a

File tree

5 files changed

+19
-13
lines changed

5 files changed

+19
-13
lines changed

src/components/input/themes/shared/input.fluent.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,13 @@ $focused-height: calc(var-get($theme, 'size') - #{($focused-border-width * 2)});
4848
}
4949

5050
[part='label'] {
51-
@include type-style('subtitle-2');
51+
@include type-style('subtitle-2') {
52+
--ig-subtitle-2-line-height: #{rem(16px)};
53+
54+
margin-block: 0 rem(5px);
55+
};
5256

5357
color: var-get($theme, 'idle-secondary-color');
54-
margin-block-end: rem(5px);
5558
}
5659

5760
[part^='container'] {

src/components/input/themes/shared/input.material.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ input:placeholder-shown + [part='notch'] [part='label'],
7272
transform 150ms cubic-bezier(0.4, 0, 0.2, 1),
7373
color 150ms cubic-bezier(0.4, 0, 0.2, 1),
7474
font-size 150ms cubic-bezier(0.4, 0, 0.2, 1);
75-
line-height: normal;
7675
text-overflow: ellipsis;
7776
overflow: hidden;
7877
will-change: font-size, color, transform;

src/components/textarea/themes/shared/textarea.bootstrap.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ $theme: $bootstrap;
2626
margin-block: 0 rem(4px);
2727
height: auto;
2828
font-size: rem(16px);
29-
line-height: normal;
3029
}
3130

3231
[part~='prefixed'] {

src/components/textarea/themes/shared/textarea.fluent.scss

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,19 @@ $theme: $fluent;
5656
}
5757

5858
[part~='label'] {
59+
@include type-style('subtitle-2') {
60+
--ig-subtitle-2-line-height: #{rem(16px)};
61+
62+
margin-block: 0 rem(5px);
63+
};
64+
5965
display: block;
60-
font-size: rem(14px);
61-
font-weight: 600;
6266
position: static;
6367
transform: translateY(0);
6468
transform-origin: top left;
65-
margin-top: 0;
6669
height: auto;
67-
margin-block-end: rem(5px);
68-
line-height: normal;
70+
71+
6972
}
7073

7174
:host([invalid]) {

src/components/textarea/themes/shared/textarea.material.scss

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,25 @@ textarea {
4343
color 150ms cubic-bezier(.4, 0, .2, 1),
4444
font-size 150ms cubic-bezier(.4, 0, .2, 1);
4545
will-change: transform;
46-
line-height: normal;
4746
}
4847

4948
%label-filled {
49+
@include type-style('caption');
50+
5051
transform: translateY(0);
5152
inset-block-start: calc(#{$input-top-padding} / 4);
52-
font-size: rem(12px);
5353
}
5454

5555
%label-outlined-filled {
56+
@include type-style('caption') {
57+
margin-block-end: auto;
58+
};
59+
5660
display: inline-block;
5761
position: relative;
5862
inset-block: 0;
5963
transform: translateY(-50%);
60-
margin-block-end: auto;
6164
padding-inline-end: 0;
62-
font-size: rem(12px);
6365
}
6466

6567
:host(:not([outlined])) {

0 commit comments

Comments
 (0)