Skip to content

Commit

Permalink
chore(sass): remove typography resolvers
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 518054505
  • Loading branch information
asyncLiz authored and copybara-github committed Mar 20, 2023
1 parent 715c592 commit 789d23b
Show file tree
Hide file tree
Showing 40 changed files with 350 additions and 201 deletions.
12 changes: 2 additions & 10 deletions badge/lib/_badge.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,20 @@

// go/keep-sorted start
@use '../../sass/theme';
@use '../../sass/typography';
@use '../../tokens';
// go/keep-sorted end

$_custom-property-prefix: 'badge';

@mixin theme($tokens) {
$tokens: theme.validate-theme(
_resolve-tokens(tokens.md-comp-badge-values()),
_resolve-tokens($tokens)
);
$tokens: theme.validate-theme(tokens.md-comp-badge-values(), $tokens);
$tokens: theme.create-theme-vars($tokens, $_custom-property-prefix);

@include theme.emit-theme-vars($tokens);
}

@mixin styles() {
$tokens: _resolve-tokens(tokens.md-comp-badge-values());
$tokens: tokens.md-comp-badge-values();
$tokens: theme.create-theme-vars($tokens, $_custom-property-prefix);

:host {
Expand Down Expand Up @@ -71,7 +67,3 @@ $_custom-property-prefix: 'badge';
font: var(--_large-label-text-type);
}
}

@function _resolve-tokens($tokens) {
@return typography.resolve-tokens($tokens, 'large-label-text');
}
2 changes: 0 additions & 2 deletions button/lib/_elevated-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
// go/keep-sorted start
@use '../../sass/shape';
@use '../../sass/theme';
@use '../../sass/typography';
@use '../../tokens';
@use './shared';
// go/keep-sorted end
Expand Down Expand Up @@ -52,6 +51,5 @@ $_custom-property-prefix: 'elevated-button';
@function _resolve-tokens($tokens) {
$tokens: shared.flatten-disabled-colors($tokens);
$tokens: shared.remove-unsupported-tokens($tokens);
$tokens: typography.resolve-tokens($tokens, 'label-text');
@return $tokens;
}
2 changes: 0 additions & 2 deletions button/lib/_filled-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
// go/keep-sorted start
@use '../../sass/shape';
@use '../../sass/theme';
@use '../../sass/typography';
@use '../../tokens';
@use './shared';
// go/keep-sorted end
Expand Down Expand Up @@ -51,6 +50,5 @@ $_custom-property-prefix: 'filled-button';
@function _resolve-tokens($tokens) {
$tokens: shared.flatten-disabled-colors($tokens);
$tokens: shared.remove-unsupported-tokens($tokens);
$tokens: typography.resolve-tokens($tokens, 'label-text');
@return $tokens;
}
2 changes: 0 additions & 2 deletions button/lib/_outlined-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
// go/keep-sorted start
@use '../../sass/shape';
@use '../../sass/theme';
@use '../../sass/typography';
@use '../../tokens';
@use './shared';
// go/keep-sorted end
Expand Down Expand Up @@ -86,6 +85,5 @@ $_custom-property-prefix: 'outlined-button';
@function _resolve-tokens($tokens) {
$tokens: shared.flatten-disabled-colors($tokens);
$tokens: shared.remove-unsupported-tokens($tokens);
$tokens: typography.resolve-tokens($tokens, 'label-text');
@return $tokens;
}
2 changes: 0 additions & 2 deletions button/lib/_text-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
// go/keep-sorted start
@use '../../sass/shape';
@use '../../sass/theme';
@use '../../sass/typography';
@use '../../tokens';
@use './shared';
// go/keep-sorted end
Expand Down Expand Up @@ -59,6 +58,5 @@ $_custom-property-prefix: 'text-button';
);
$tokens: shared.flatten-disabled-colors($tokens);
$tokens: shared.remove-unsupported-tokens($tokens);
$tokens: typography.resolve-tokens($tokens, 'label-text');
@return $tokens;
}
2 changes: 0 additions & 2 deletions button/lib/_tonal-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
// go/keep-sorted start
@use '../../sass/shape';
@use '../../sass/theme';
@use '../../sass/typography';
@use '../../tokens';
@use './shared';
// go/keep-sorted end
Expand Down Expand Up @@ -51,6 +50,5 @@ $_custom-property-prefix: 'tonal-button';
@function _resolve-tokens($tokens) {
$tokens: shared.flatten-disabled-colors($tokens);
$tokens: shared.remove-unsupported-tokens($tokens);
$tokens: typography.resolve-tokens($tokens, 'label-text');
@return $tokens;
}
2 changes: 0 additions & 2 deletions chips/lib/_shared.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
@use '../../focus/focus-ring';
@use '../../ripple/ripple';
@use '../../sass/shape';
@use '../../sass/typography';
// go/keep-sorted end

@mixin styles() {
Expand Down Expand Up @@ -107,6 +106,5 @@
'dragged-state-layer-color',
'dragged-state-layer-opacity'
);
$tokens: typography.resolve-tokens($tokens, 'label-text');
@return $tokens;
}
3 changes: 1 addition & 2 deletions dialog/lib/_tokens.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
@use '../../sass/shape';
@use '../../sass/string-ext';
@use '../../sass/theme';
@use '../../sass/typography';
@use '../../sass/var';
@use '../../tokens';
// go/keep-sorted end
Expand Down Expand Up @@ -75,7 +74,7 @@ $_fullscreen-tokens: (
$remove-prefix: 'action-';
$tokens: _map-without-keys-with-prefix($tokens, $remove-prefix);

@return typography.resolve-tokens($tokens, 'headline', 'supporting-text');
@return $tokens;
}

/**
Expand Down
11 changes: 3 additions & 8 deletions fab/lib/_fab-extended.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
// go/keep-sorted start
@use '../../sass/shape';
@use '../../sass/theme';
@use '../../sass/typography';
@use '../../tokens';
@use './shared';
// go/keep-sorted end

@mixin theme($tokens) {
$tokens: theme.validate-theme(
_resolve-typography(tokens.md-comp-extended-fab-surface-values()),
_resolve-typography($tokens)
tokens.md-comp-extended-fab-surface-values(),
$tokens
);
$tokens: theme.create-theme-vars($tokens, 'fab-extended');
$tokens: shape.resolve-tokens($tokens, 'container-shape');
Expand All @@ -29,7 +28,7 @@
}

@mixin styles() {
$tokens: _resolve-typography(tokens.md-comp-extended-fab-surface-values());
$tokens: tokens.md-comp-extended-fab-surface-values();
$tokens: theme.create-theme-vars($tokens, 'fab-extended');
$tokens: shape.resolve-tokens($tokens, 'container-shape');

Expand Down Expand Up @@ -72,7 +71,3 @@
}
}
}

@function _resolve-typography($tokens) {
@return typography.resolve-tokens($tokens, 'label-text');
}
21 changes: 1 addition & 20 deletions list/lib/listitem/_list-item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
@use '../../../ripple/ripple';
@use '../../../sass/map-ext';
@use '../../../sass/theme';
@use '../../../sass/typography';
@use '../../../tokens';
// go/keep-sorted end

Expand Down Expand Up @@ -453,16 +452,6 @@
}
}

// Do not include list-item-trailing-supporting-text or list-item-label-text
// because we actually need the line-height tokens separately from the
// *-type tokens.
$list-item-tokens: typography.resolve-tokens(
$list-item-tokens,
'list-item-supporting-text',
'list-item-leading-avatar-label',
'list-item-overline'
);

$list-item-tokens: _remove-unused-tokens($list-item-tokens);

@return $list-item-tokens;
Expand All @@ -484,15 +473,7 @@
'list-item-overline-type',
'list-item-selected-trailing-icon',
'list-item-selected-trailing-icon-color',
'list-item-unselected-trailing-icon-color',
'list-item-label-text-font',
'list-item-label-text-size',
'list-item-label-text-tracking',
'list-item-label-text-weight',
'list-item-trailing-supporting-text-font',
'list-item-trailing-supporting-text-size',
'list-item-trailing-supporting-text-tracking',
'list-item-trailing-supporting-text-weight'
'list-item-unselected-trailing-icon-color'
);

@each $token in $unused-tokens {
Expand Down
11 changes: 3 additions & 8 deletions navigationtab/lib/_navigation-tab.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
@use '../../motion/animation';
@use '../../ripple/ripple';
@use '../../sass/theme';
@use '../../sass/typography';
@use '../../tokens';
// go/keep-sorted end

Expand All @@ -24,8 +23,8 @@ $_custom-property-prefix: 'navigation-bar';

@mixin theme($tokens) {
$tokens: theme.validate-theme(
_resolve-tokens(tokens.md-comp-navigation-bar-values()),
_resolve-tokens($tokens)
tokens.md-comp-navigation-bar-values(),
$tokens
);

$tokens: theme.create-theme-vars($tokens, $_custom-property-prefix);
Expand All @@ -34,7 +33,7 @@ $_custom-property-prefix: 'navigation-bar';
}

@mixin styles() {
$tokens: _resolve-tokens(tokens.md-comp-navigation-bar-values());
$tokens: tokens.md-comp-navigation-bar-values();
$tokens: theme.create-theme-vars($tokens, $_custom-property-prefix);

:host {
Expand Down Expand Up @@ -260,7 +259,3 @@ $_custom-property-prefix: 'navigation-bar';
);
}
}

@function _resolve-tokens($tokens) {
@return typography.resolve-tokens($tokens, 'label-text');
}
39 changes: 0 additions & 39 deletions sass/_typography.scss

This file was deleted.

56 changes: 0 additions & 56 deletions sass/test/_typography.test.scss

This file was deleted.

1 change: 0 additions & 1 deletion sass/test/test.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
@use './map-ext.test';
@use './shape.test';
@use './string-ext.test';
@use './typography.test';
// go/keep-sorted end
2 changes: 0 additions & 2 deletions segmentedbutton/lib/_shared.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
@use '../../ripple/ripple';
@use '../../sass/color';
@use '../../sass/touch-target';
@use '../../sass/typography';
// go/keep-sorted end

@mixin styles() {
Expand Down Expand Up @@ -357,7 +356,6 @@
}

@function resolve-tokens($tokens) {
$tokens: typography.resolve-tokens($tokens, 'label-text');
$tokens: _flatten-disabled-colors($tokens);
@return $tokens;
}
Expand Down
2 changes: 0 additions & 2 deletions slider/lib/_slider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@
@use '../../sass/color';
@use '../../sass/shape';
@use '../../sass/theme';
@use '../../sass/typography';
@use '../../sass/var';
@use './tokens';
// go/keep-sorted end

@mixin theme($tokens) {
$tokens: tokens.remove-unsupported-tokens($tokens);
$tokens: typography.resolve-tokens($tokens, 'label-label-text');
$tokens: theme.validate-theme(tokens.md-comp-slider-values(), $tokens);
$tokens: theme.create-theme-vars($tokens, 'slider');

Expand Down
Loading

0 comments on commit 789d23b

Please sign in to comment.