Skip to content

Commit

Permalink
feat(textfield): Update Readme to reflect latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
amsheehan committed Oct 20, 2017
1 parent be494d7 commit 36b7010
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
13 changes: 7 additions & 6 deletions packages/mdc-textfield/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,16 +281,17 @@ text, validation, and dense UI.

### Sass Mixins

To customize a Text Field's border radii, you can use the following mixins.
To customize a Filled Text Field or a Text Field `textarea`'s border radius, you can use the following mixins.
Alternatively, if you would like to change the border radius for every instance of MDC Text Field uniformly, regardless
of the variant, you can override $mdc-text-field-border-radius in Sass.

#### `mdc-text-field-corner-radius($position, $radius)`
#### `mdc-text-field-box-corner-radius($radius)`

This mixin is provided for customizing the border radius for a corner of a Text Field at the given position,
e.g.: `@include mdc-text-field-corner-radius(top-left, 10px)` will apply `border-top-left-radius: 10px` to that Text Field.
This mixin is provided for customizing the border radius for Text Field Box.

#### `mdc-text-field-corner-radius-all($radius)`
#### `mdc-text-field-textarea-corner-radius($radius)`

This mixin is provided for customizing the border radius for all four corners of a Text Field.
This mixin is provided for customizing the border radius for a Text Field `textarea`.

### Using the JS component

Expand Down
4 changes: 2 additions & 2 deletions packages/mdc-textfield/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
// limitations under the License.
//

@mixin mdc-text-field-box-corner-radius($top-left-radius, $top-right-radius: $top-left-radius) {
border-radius: $top-left-radius $top-right-radius 0 0;
@mixin mdc-text-field-box-corner-radius($radius) {
border-radius: $radius $radius 0 0;
}

@mixin mdc-text-field-textarea-corner-radius($radius) {
Expand Down
2 changes: 1 addition & 1 deletion packages/mdc-textfield/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ $mdc-textarea-dark-background: rgba(48, 48, 48, 1);
$mdc-textarea-disabled-background-on-light: rgba(249, 249, 249, 1);
$mdc-textarea-disabled-background-on-dark: rgba(47, 47, 47, 1);

$mdc-textfield-border-radius: 4px !default;
$mdc-text-field-border-radius: 4px !default;
4 changes: 2 additions & 2 deletions packages/mdc-textfield/mdc-textfield.scss
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
}

.mdc-textfield--box {
@include mdc-text-field-box-corner-radius($mdc-textfield-default-border-radius);
@include mdc-text-field-box-corner-radius($mdc-text-field-border-radius);

display: inline-flex;
position: relative;
Expand Down Expand Up @@ -503,7 +503,7 @@
}

.mdc-textfield--textarea {
@include mdc-text-field-textarea-corner-radius($mdc-textfield-default-border-radius);
@include mdc-text-field-textarea-corner-radius($mdc-text-field-border-radius);

$padding-inset: 16px;
$label-offset-y: $padding-inset + 2;
Expand Down

0 comments on commit 36b7010

Please sign in to comment.