Skip to content

Commit

Permalink
feat(textfield): add leading/trailing icon spacing tokens
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 662251081
  • Loading branch information
material-web-copybara authored and copybara-github committed Aug 12, 2024
1 parent b8f362a commit 0d1ae58
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
12 changes: 4 additions & 8 deletions field/internal/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,14 @@ $_enter-delay: $_label-duration - $_visible-duration;
justify-content: center;
}

// TODO(b/239188049): remove when layout tokens are ready
.with-start .start,
.with-end .end {
min-width: 48px;
}

.with-start .start {
margin-inline-end: 4px;
margin-inline: var(--_with-leading-icon-leading-space)
var(--_with-leading-icon-trailing-space);
}

.with-end .end {
margin-inline-start: 4px;
margin-inline: var(--_with-trailing-icon-leading-space)
var(--_with-trailing-icon-trailing-space);
}

.middle {
Expand Down
10 changes: 10 additions & 0 deletions tokens/_md-comp-filled-field.scss
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ $supported-tokens: (
'trailing-space',
'with-label-bottom-space',
'with-label-top-space',
'with-leading-icon-leading-space',
'with-leading-icon-trailing-space',
'with-trailing-icon-leading-space',
'with-trailing-icon-trailing-space',
// go/keep-sorted end
);

Expand Down Expand Up @@ -256,6 +260,12 @@ $_default: (
'trailing-space': if($exclude-hardcoded-values, null, 16px),
'with-label-bottom-space': if($exclude-hardcoded-values, null, 8px),
'with-label-top-space': if($exclude-hardcoded-values, null, 8px),
'with-leading-icon-leading-space': if($exclude-hardcoded-values, null, 12px),
'with-leading-icon-trailing-space':
if($exclude-hardcoded-values, null, 16px),
'with-trailing-icon-leading-space': if($exclude-hardcoded-values, null, 16px),
'with-trailing-icon-trailing-space':
if($exclude-hardcoded-values, null, 12px),
// go/keep-sorted end
);

Expand Down
10 changes: 10 additions & 0 deletions tokens/_md-comp-outlined-field.scss
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ $supported-tokens: (
'top-space',
'trailing-content-color',
'trailing-space',
'with-leading-icon-leading-space',
'with-leading-icon-trailing-space',
'with-trailing-icon-leading-space',
'with-trailing-icon-trailing-space',
// go/keep-sorted end
);

Expand Down Expand Up @@ -231,6 +235,12 @@ $_default: (
'top-space': if($exclude-hardcoded-values, null, 16px),
'trailing-content-color': map.get($text-field, 'trailing-icon-color'),
'trailing-space': if($exclude-hardcoded-values, null, 16px),
'with-leading-icon-leading-space': if($exclude-hardcoded-values, null, 12px),
'with-leading-icon-trailing-space':
if($exclude-hardcoded-values, null, 16px),
'with-trailing-icon-leading-space': if($exclude-hardcoded-values, null, 16px),
'with-trailing-icon-trailing-space':
if($exclude-hardcoded-values, null, 12px),
// go/keep-sorted end
);

Expand Down

0 comments on commit 0d1ae58

Please sign in to comment.