Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

feat(floating-label): Add max-width mixin #2956

Merged
merged 4 commits into from
Jul 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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