From 359c9bb2df3102d02514d06b1bcbc300cb67607c Mon Sep 17 00:00:00 2001 From: Marshall Cottrell Date: Fri, 10 Mar 2017 12:40:19 -0600 Subject: [PATCH] fix(input): make all icons in input containers the correct size (#3489) * fix(input): make all icons in input containers the correct size * docs(input): add icon prefix/suffix example --- src/demo-app/baseline/baseline-demo.scss | 7 ------- src/demo-app/input/input-demo.html | 17 ++++++++++++++--- src/demo-app/input/input-demo.scss | 7 ------- src/lib/input/input-container.scss | 16 ++++++++-------- 4 files changed, 22 insertions(+), 25 deletions(-) diff --git a/src/demo-app/baseline/baseline-demo.scss b/src/demo-app/baseline/baseline-demo.scss index 2e25ae8f151..259047d9b26 100644 --- a/src/demo-app/baseline/baseline-demo.scss +++ b/src/demo-app/baseline/baseline-demo.scss @@ -9,13 +9,6 @@ width: 100%; } -.demo-icons { - font-size: 100%; - height: inherit; - vertical-align: top; - width: inherit; -} - .demo-card { margin: 16px; } diff --git a/src/demo-app/input/input-demo.html b/src/demo-app/input/input-demo.html index b42834fc114..7559ddf3891 100644 --- a/src/demo-app/input/input-demo.html +++ b/src/demo-app/input/input-demo.html @@ -40,7 +40,10 @@ - {{postalCode.value.length}} / 5 + + mode_edit + {{postalCode.value.length}} / 5 + @@ -51,11 +54,19 @@ Prefix + Suffix +

Text

$  .00 + +

Icons

+ + + attach_money + mode_edit +
@@ -152,10 +163,10 @@ - I favorite bold placeholder + I favorite bold placeholder - I also home italic hint labels + I also home italic hint labels

diff --git a/src/demo-app/input/input-demo.scss b/src/demo-app/input/input-demo.scss index 5e5a3ef59da..2325e7c6789 100644 --- a/src/demo-app/input/input-demo.scss +++ b/src/demo-app/input/input-demo.scss @@ -8,13 +8,6 @@ width: 100%; } -.demo-icons { - font-size: 100%; - height: inherit; - vertical-align: top; - width: inherit; -} - .demo-card { margin: 16px; } diff --git a/src/lib/input/input-container.scss b/src/lib/input/input-container.scss index 134a05e9df1..7a7f1093407 100644 --- a/src/lib/input/input-container.scss +++ b/src/lib/input/input-container.scss @@ -27,6 +27,14 @@ $mat-input-underline-disabled-background-image: [dir='rtl'] & { text-align: right; } + + // Allow icons in a prefix/suffix/hint/etc to adapt to the correct size. + & .mat-icon { + width: auto; + height: auto; + font-size: 100%; + vertical-align: top; + } } // Global wrapper. We need to apply margin to the element for spacing, but @@ -238,12 +246,4 @@ $mat-input-underline-disabled-background-image: // Prevents the prefix and suffix from stretching together with the container. width: 0.1px; white-space: nowrap; - - // Allow icons in a prefix/suffix to adapt to the correct size. - & .mat-icon { - width: auto; - height: auto; - font-size: 100%; - vertical-align: top; - } }