Skip to content

Commit 0df4d08

Browse files
committed
fixup! build: Report duplicate style warnings for M3 themes
1 parent 305af4f commit 0df4d08

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/material/core/theming/_inspection.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,30 @@
66

77
$_internals: _mat-theming-internals-do-not-access;
88

9+
/// Validates that the given value is a versioned theme object.
10+
/// @param {Any} $theme The theme object to validate.
11+
/// @return {Boolean|Null} true if the theme has errors, else null.
912
@function _validate-theme-object($theme) {
1013
$err: validation.validate-type($theme, 'map') or
1114
map.get($theme, $_internals, theme-version) == null;
1215
@return if($err, true, null);
1316
}
1417

18+
/// Gets the version number of a theme object. A theme that is not a valid versioned theme object is
19+
/// considered to be version 0.
20+
/// @param {Map} $theme The theme to check the version of
21+
/// @return {Number} The version number of the theme (0 if unknown).
1522
@function get-theme-version($theme) {
1623
$err: _validate-theme-object($theme);
1724
@return if($err, 0, map.get($theme, $_internals, theme-version) or 0);
1825
}
1926

27+
/// Gets the set of tokens from the given theme, limited to those affected by the requested theming
28+
/// systems.
29+
/// @param {Map} $theme The theme to get tokens from.
30+
/// @param {String...} $systems The theming systems to get tokens for. Valid values are: color,
31+
/// typography, density, other. If no systems are passed, all tokens will be returned.
32+
/// @return {Map} The requested tokens for the theme.
2033
@function get-theme-tokens($theme, $systems...) {
2134
$systems: if(list.length($systems) == 0, (color, typography, density, other), $systems);
2235
$err: _validate-theme-object($theme);

0 commit comments

Comments
 (0)