diff --git a/packages/mdc-textfield/README.md b/packages/mdc-textfield/README.md index 1f062ab83dc..2439ac3f52b 100644 --- a/packages/mdc-textfield/README.md +++ b/packages/mdc-textfield/README.md @@ -287,11 +287,11 @@ of the variant, you can override $mdc-text-field-border-radius in Sass. #### `mdc-text-field-box-corner-radius($radius)` -This mixin is provided for customizing the border radius for Text Field Box. +This mixin customizes the border radius for a Text Field Box. #### `mdc-text-field-textarea-corner-radius($radius)` -This mixin is provided for customizing the border radius for a Text Field `textarea`. +This mixin customizes the border radius for a Text Field `textarea`. ### Using the JS component diff --git a/packages/mdc-textfield/_mixins.scss b/packages/mdc-textfield/_mixins.scss index da68a2ddc6b..22ac94ff9f1 100644 --- a/packages/mdc-textfield/_mixins.scss +++ b/packages/mdc-textfield/_mixins.scss @@ -22,7 +22,9 @@ border-radius: $radius; .mdc-textfield__label { - border-radius: $radius; + // Bottom corners are square to prevent weird edge cases + // where text would be visible outside of the curve. + border-radius: $radius $radius 0 0; } .mdc-textfield__input { @@ -30,12 +32,8 @@ // of the radius of its parent. This prevents an ugly space of // background between the two borders in each corner when the // textarea is focused. This also means we need to guard against - // invalid output with @if/@else directives. - @if ($radius >= 2) { - border-radius: $radius - 2; - } @else { - border-radius: 0; - } + // invalid output. + border-radius: max($radius - 2, 0); } }