Skip to content

Commit d1d5749

Browse files
committed
refactor: fixes found from internal changes
1 parent 76a4268 commit d1d5749

File tree

2 files changed

+9
-23
lines changed

2 files changed

+9
-23
lines changed

src/material/core/tokens/_token-utils.scss

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
// Returns the token slot value.
4848
// Accepts an optional fallback parameter to include in the CSS variable.
4949
// If $fallback is `true`, then use the tokens map to get the fallback.
50-
// TODO: Remove the use case where we accept "true" and handle any failing client screenshots
5150
@function slot($token, $fallbacks, $fallback: null) {
5251
// Fallbacks are a map of base, color, typography, and density tokens. To simplify
5352
// lookup, flatten these token groups into a single map.
@@ -112,7 +111,7 @@
112111
@each $config in $namespace-configs {
113112
$namespace: map.get($config, namespace);
114113
$prefix: if(map.has-key($config, prefix), map.get($config, prefix), '');
115-
$tokens: _filter-nulls(map.get(map.get($config, tokens), all));
114+
$tokens: map.get(map.get($config, tokens), all);
116115
@each $name, $value in $tokens {
117116
$prefixed-name: $prefix + $name;
118117
$all-names: list.append($all-names, $prefixed-name, $separator: comma);
@@ -133,16 +132,3 @@
133132
}
134133
}
135134
}
136-
137-
/// Filters keys with a null value out of the map.
138-
/// @param {Map} $map The map to filter.
139-
/// @return {Map} The given map with all of the null keys filtered out.
140-
@function _filter-nulls($map) {
141-
$result: ();
142-
@each $key, $val in $map {
143-
@if $val != null {
144-
$result: map.set($result, $key, $val);
145-
}
146-
}
147-
@return $result;
148-
}

src/material/table/table.scss

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ $fallbacks: m3-table.get-tokens();
1313
}
1414

1515
@mixin _cell-border {
16-
border-bottom-color: token-utils.slot(table-row-item-outline-color, $fallbacks, true);
17-
border-bottom-width: token-utils.slot(table-row-item-outline-width, $fallbacks, true);
16+
border-bottom-color: token-utils.slot(table-row-item-outline-color, $fallbacks, rgba(0, 0, 0, 0.12));
17+
border-bottom-width: token-utils.slot(table-row-item-outline-width, $fallbacks, 1px);
1818
border-bottom-style: solid;
1919
}
2020

@@ -50,16 +50,16 @@ $fallbacks: m3-table.get-tokens();
5050
.mat-mdc-header-row {
5151
@include vendor-prefixes.smooth-font;
5252
height: token-utils.slot(table-header-container-height, $fallbacks, 56px);
53-
color: token-utils.slot(table-header-headline-color, $fallbacks, true);
54-
font-family: token-utils.slot(table-header-headline-font, $fallbacks, true);
53+
color: token-utils.slot(table-header-headline-color, $fallbacks, rgba(0, 0, 0, 0.87));
54+
font-family: token-utils.slot(table-header-headline-font, $fallbacks, (Roboto, sans-serif));
5555
line-height: token-utils.slot(table-header-headline-line-height, $fallbacks);
5656
font-size: token-utils.slot(table-header-headline-size, $fallbacks, 14px);
5757
font-weight: token-utils.slot(table-header-headline-weight, $fallbacks, 500);
5858
}
5959

6060
.mat-mdc-row {
6161
height: token-utils.slot(table-row-item-container-height, $fallbacks, 52px);
62-
color: token-utils.slot(table-row-item-label-text-color, $fallbacks, true);
62+
color: token-utils.slot(table-row-item-label-text-color, $fallbacks, rgba(0, 0, 0, 0.87));
6363
}
6464

6565
// Note that while it's redundant to apply the typography both to the row
@@ -69,7 +69,7 @@ $fallbacks: m3-table.get-tokens();
6969
.mat-mdc-row,
7070
.mdc-data-table__content {
7171
@include vendor-prefixes.smooth-font;
72-
font-family: token-utils.slot(table-row-item-label-text-font, $fallbacks, true);
72+
font-family: token-utils.slot(table-row-item-label-text-font, $fallbacks, (Roboto, sans-serif));
7373
line-height: token-utils.slot(table-row-item-label-text-line-height, $fallbacks);
7474
font-size: token-utils.slot(table-row-item-label-text-size, $fallbacks, 14px);
7575
font-weight: token-utils.slot(table-row-item-label-text-weight, $fallbacks);
@@ -78,8 +78,8 @@ $fallbacks: m3-table.get-tokens();
7878
.mat-mdc-footer-row {
7979
@include vendor-prefixes.smooth-font;
8080
height: token-utils.slot(table-footer-container-height, $fallbacks, 52px);
81-
color: token-utils.slot(table-row-item-label-text-color, $fallbacks, true);
82-
font-family: token-utils.slot(table-footer-supporting-text-font, $fallbacks, true);
81+
color: token-utils.slot(table-row-item-label-text-color, $fallbacks, rgba(0, 0, 0, 0.87));
82+
font-family: token-utils.slot(table-footer-supporting-text-font, $fallbacks, (Roboto, sans-serif));
8383
line-height: token-utils.slot(table-footer-supporting-text-line-height, $fallbacks);
8484
font-size: token-utils.slot(table-footer-supporting-text-size, $fallbacks, 14px);
8585
font-weight: token-utils.slot(table-footer-supporting-text-weight, $fallbacks);

0 commit comments

Comments
 (0)