Skip to content

Commit

Permalink
feat(floating-label): Add max-width mixin (#2956)
Browse files Browse the repository at this point in the history
  • Loading branch information
EstebanG23 committed Jul 18, 2018
1 parent a5bea1b commit 66f8bf7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/mdc-floating-label/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ Mixin | Description
`mdc-floating-label-shake-keyframes($modifier, $positionY, $positionX, $scale)` | Generates a CSS `@keyframes` at-rule for an invalid label shake. Used in conjunction with the `mdc-floating-label-shake-animation` mixin.
`mdc-floating-label-shake-animation($modifier)` | Applies shake keyframe animation to label.
`mdc-floating-label-float-position($positionY, $positionX, $scale)` | Sets position of label when floating.
`mdc-floating-label-max-width($max-width)` | Sets the max width of the label.

## `MDCFloatingLabel` Properties and Methods

Expand Down
4 changes: 4 additions & 0 deletions packages/mdc-floating-label/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,7 @@
animation: mdc-floating-label-shake-float-above-#{$modifier} 250ms 1;
}
}

@mixin mdc-floating-label-max-width($max-width) {
max-width: $max-width;
}
6 changes: 6 additions & 0 deletions packages/mdc-floating-label/mdc-floating-label.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@
transform $mdc-floating-label-transition-duration $mdc-animation-standard-curve-timing-function,
color $mdc-floating-label-transition-duration $mdc-animation-standard-curve-timing-function;
line-height: 1.15rem;
text-overflow: ellipsis;
white-space: nowrap;
cursor: text;
overflow: hidden;
// Force the label into its own layer to prevent visible layer promotion adjustments
// when the ripple is activated behind it.
will-change: transform;

@include mdc-rtl {
/* @noflip */
Expand Down

0 comments on commit 66f8bf7

Please sign in to comment.