From 51363618c6027a3d273ded7e6b1cd1ecfc5fa183 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Tue, 23 Jan 2018 16:40:56 +0100 Subject: [PATCH] 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 --- src/lib/input/input.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/input/input.scss b/src/lib/input/input.scss index 38fdfd02435..6479e3d4467 100644 --- a/src/lib/input/input.scss +++ b/src/lib/input/input.scss @@ -26,6 +26,12 @@ // Needed to make last line of the textarea line up with the baseline. vertical-align: bottom; + // 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, the alignment should be inherited here. + text-align: inherit; + // Undo the red box-shadow glow added by Firefox on invalid inputs. // See https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-ui-invalid &:-moz-ui-invalid {