Skip to content

Commit

Permalink
fix(labs): remove font shorthand tokens
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 563195627
  • Loading branch information
asyncLiz authored and copybara-github committed Sep 6, 2023
1 parent 08acc41 commit acd40a2
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 30 deletions.
5 changes: 4 additions & 1 deletion labs/badge/internal/_badge.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
}

.md3-badge__value {
font: var(--_large-label-text-type);
font-family: var(--_large-label-text-font);
font-size: var(--_large-label-text-size);
line-height: var(--_large-label-text-line-height);
font-weight: var(--_large-label-text-weight);
}
}
5 changes: 4 additions & 1 deletion labs/navigationtab/internal/_navigation-tab.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ $animation-duration: 100ms;
position: relative;
text-align: center;
width: 100%;
font: var(--_label-text-type);
font-family: var(--_label-text-font);
font-size: var(--_label-text-size);
line-height: var(--_label-text-line-height);
font-weight: var(--_label-text-weight);

// Firefox draws a dotted border around focused buttons unless specifically overridden.
&::-moz-focus-inner {
Expand Down
5 changes: 4 additions & 1 deletion labs/segmentedbutton/internal/_shared.scss
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@
}

.md3-segmented-button__label-text {
font: var(--_label-text-type);
font-family: var(--_label-text-font);
font-size: var(--_label-text-size);
line-height: var(--_label-text-line-height);
font-weight: var(--_label-text-weight);
}

&.md3-segmented-button--selected:enabled {
Expand Down
15 changes: 1 addition & 14 deletions tokens/_md-comp-badge.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,10 @@ $_default: (
'md-sys-typescale': md-sys-typescale.values(),
);

$_unsupported-tokens: (
'large-label-text-font',
'large-label-text-line-height',
'large-label-text-size',
'large-label-text-tracking',
'large-label-text-weight'
);
$_unsupported-tokens: ('large-label-text-tracking', 'large-label-text-type');

@function values($deps: $_default, $exclude-hardcoded-values: false) {
$tokens: md-comp-badge.values($deps, $exclude-hardcoded-values);
$tokens: map.remove($tokens, $_unsupported-tokens...);
// TODO(b/271876162): remove when tokens compiler emits typescale tokens
$tokens: map.merge(
$tokens,
(
'large-label-text-type': map.get($deps, 'md-sys-typescale', 'label-small'),
)
);
@return $tokens;
}
18 changes: 5 additions & 13 deletions tokens/_md-comp-outlined-segmented-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ $supported-tokens: (
'disabled-outline-color',
'hover-state-layer-opacity',
'icon-size',
'label-text-type',
'label-text-font',
'label-text-line-height',
'label-text-size',
'label-text-weight',
'outline-color',
'pressed-state-layer-opacity',
'selected-container-color',
Expand Down Expand Up @@ -56,11 +59,8 @@ $unsupported-tokens: (
'disabled-label-text-opacity',
'disabled-outline-opacity',
'focus-state-layer-opacity',
'label-text-font',
'label-text-line-height',
'label-text-size',
'label-text-tracking',
'label-text-weight',
'label-text-type',
'outline-width',
'selected-focus-state-layer-color',
'unselected-focus-state-layer-color',
Expand All @@ -87,13 +87,5 @@ $_default: (
)
);

// TODO(b/271876162): remove when tokens compiler emits typescale tokens
$tokens: map.merge(
$tokens,
(
'label-text-type': map.get($deps, 'md-sys-typescale', 'label-large'),
)
);

@return $tokens;
}

0 comments on commit acd40a2

Please sign in to comment.