Skip to content

Commit

Permalink
fix(textfield)!: rename prefix/suffix padding tokens
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Rename `--md-*-text-field-input-text-prefix-padding` and `--md-*-text-field-input-text-suffix-padding` to `--md-*-text-field-input-text-prefix-trailing-space` and `--md-*-text-field-input-text-suffix-leading-space`

PiperOrigin-RevId: 547210256
  • Loading branch information
asyncLiz authored and copybara-github committed Jul 11, 2023
1 parent 4596c4a commit 53966af
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 31 deletions.
29 changes: 4 additions & 25 deletions textfield/lib/_filled-text-field.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
'container-shape-end-start',
'container-padding-horizontal',
'container-padding-vertical',
'input-text-prefix-padding',
'input-text-suffix-padding',
'input-text-prefix-trailing-space',
'input-text-suffix-leading-space',
'focus-caret-color'
)
);
Expand All @@ -51,8 +51,8 @@
(
'container-padding-horizontal': 16px,
'container-padding-vertical': 16px,
'input-text-prefix-padding': 2px,
'input-text-suffix-padding': 2px,
'input-text-prefix-trailing-space': 2px,
'input-text-suffix-leading-space': 2px,
'with-label-container-padding-vertical': 8px,
// TODO(b/270705687): remove when focus-caret-color token added
'focus-caret-color':
Expand Down Expand Up @@ -182,24 +182,3 @@
);
}
}

@function _resolve-tokens($tokens, $exclude-hardcoded-values: false) {
@if not $exclude-hardcoded-values {
// Add missing tokens
$tokens: map.merge(
(
'container-padding-horizontal': 16px,
'container-padding-vertical': 16px,
'input-text-prefix-padding': 2px,
'input-text-suffix-padding': 2px,
'with-label-container-padding-vertical': 8px,
// TODO(b/270705687): remove when focus-caret-color token added
'focus-caret-color':
map.get(tokens.md-sys-color-values-light(), 'primary'),
),
$tokens
);
}

@return $tokens;
}
4 changes: 2 additions & 2 deletions textfield/lib/_input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@
}

.prefix {
padding-inline-end: var(--_input-text-prefix-padding);
padding-inline-end: var(--_input-text-prefix-trailing-space);
}

.suffix {
padding-inline-start: var(--_input-text-suffix-padding);
padding-inline-start: var(--_input-text-suffix-leading-space);
}
}
8 changes: 4 additions & 4 deletions textfield/lib/_outlined-text-field.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
'container-shape-end-start',
'container-padding-horizontal',
'container-padding-vertical',
'input-text-prefix-padding',
'input-text-suffix-padding',
'input-text-prefix-trailing-space',
'input-text-suffix-leading-space',
'focus-caret-color'
)
);
Expand All @@ -46,8 +46,8 @@
(
'container-padding-horizontal': 16px,
'container-padding-vertical': 16px,
'input-text-prefix-padding': 2px,
'input-text-suffix-padding': 2px,
'input-text-prefix-trailing-space': 2px,
'input-text-suffix-leading-space': 2px,
// TODO(b/270705687): remove when focus-caret-color token added
'focus-caret-color':
map.get(tokens.md-sys-color-values-light(), 'primary'),
Expand Down

0 comments on commit 53966af

Please sign in to comment.