Skip to content

Commit

Permalink
fix(textfield): affix outlined alignment Safari bug
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 321265311
  • Loading branch information
asyncLiz authored and copybara-github committed Jul 15, 2020
1 parent a0f1202 commit ad4df58
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions packages/mdc-textfield/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@
.mdc-text-field--no-label & {
@include _affix-visible($query: $query);
}

// Safari only
@supports (-webkit-hyphens: none) {
.mdc-text-field--outlined & {
@include _centered-affix-safari-support($query: $query);
}
}
}

.mdc-text-field__affix--prefix {
Expand Down Expand Up @@ -1541,6 +1548,13 @@
display: none;
}
}

// Safari only
@supports (-webkit-hyphens: none) {
.mdc-text-field__affix {
@include _centered-affix-safari-support($query: $query);
}
}
}

// Outlined
Expand Down Expand Up @@ -2278,6 +2292,21 @@
}
}

// TODO(b/155467610): Remove when Safari supports baseline alignment
// https://github.com/material-components/material-components-web/issues/5879
@mixin _centered-affix-safari-support(
$query: feature-targeting-functions.all()
) {
$feat-structure: feature-targeting-functions.create-target($query, structure);

@include feature-targeting-mixins.targets($feat-structure) {
align-items: center;
align-self: center;
display: inline-flex;
height: 100%;
}
}

@mixin _affix-visible($query: feature-targeting-functions.all()) {
$feat-structure: feature-targeting-functions.create-target($query, structure);

Expand Down

0 comments on commit ad4df58

Please sign in to comment.