-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(material/core): simplify internal form field styles (#29389)
Reworks the internal form field styles to be smaller and easier to maintain. (cherry picked from commit ca7c090)
- Loading branch information
Showing
1 changed file
with
35 additions
and
7 deletions.
There are no files selected for viewing
42 changes: 35 additions & 7 deletions
42
src/material/core/internal-form-field/internal-form-field.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,40 @@ | ||
@use '@material/form-field/form-field' as mdc-form-field; | ||
@use '@material/theme/custom-properties' as mdc-custom-properties; | ||
@use '../style/vendor-prefixes'; | ||
@use '../mdc-helpers/mdc-helpers'; | ||
|
||
@include mdc-custom-properties.configure($emit-fallback-values: false, $emit-fallback-vars: false) { | ||
@include mdc-form-field.static-styles($query: mdc-helpers.$mdc-base-styles-query); | ||
} | ||
|
||
.mat-internal-form-field { | ||
@include vendor-prefixes.smooth-font(); | ||
display: inline-flex; | ||
align-items: center; | ||
vertical-align: middle; | ||
|
||
& > label { | ||
margin-left: 0; | ||
margin-right: auto; | ||
padding-left: 4px; | ||
padding-right: 0; | ||
order: 0; | ||
} | ||
|
||
[dir='rtl'] & > label { | ||
margin-left: auto; | ||
margin-right: 0; | ||
padding-left: 0; | ||
padding-right: 4px; | ||
} | ||
} | ||
|
||
.mdc-form-field--align-end { | ||
& > label { | ||
margin-left: auto; | ||
margin-right: 0; | ||
padding-left: 0; | ||
padding-right: 4px; | ||
order: -1; | ||
} | ||
|
||
[dir='rtl'] .mdc-form-field--align-end & label { | ||
margin-left: 0; | ||
margin-right: auto; | ||
padding-left: 4px; | ||
padding-right: 0; | ||
} | ||
} |