Skip to content

Commit 5136361

Browse files
devversionjelbourn
authored andcommitted
fix(input): respect text-align value from form-field (#9397)
User agent stylesheets set the text-align of inputs explicitly to "start". Those can be easily overwritten by targeting the input element using a simple CSS selector, but since the text-align will be applied most of the time on the `mat-form-field` to also align the placeholder/label, the alignment should be inherited on the input. Related to #5332
1 parent b3d2e78 commit 5136361

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/lib/input/input.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626
// Needed to make last line of the textarea line up with the baseline.
2727
vertical-align: bottom;
2828

29+
// User agent stylesheets set the text-align of inputs explicitly to "start". Those can be
30+
// easily overwritten by targeting the input element using a simple CSS selector, but since
31+
// the text-align will be applied most of the time on the `mat-form-field` to also align the
32+
// placeholder, the alignment should be inherited here.
33+
text-align: inherit;
34+
2935
// Undo the red box-shadow glow added by Firefox on invalid inputs.
3036
// See https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-ui-invalid
3137
&:-moz-ui-invalid {

0 commit comments

Comments
 (0)