_id
stringlengths 21
254
| text
stringlengths 1
93.7k
| metadata
dict |
---|---|---|
components/src/material/core/tokens/m2/mat/_expansion.scss_0_3683 | @use 'sass:map';
@use '../../token-definition';
@use '../../../theming/theming';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, expansion);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return (
container-shape: 4px,
legacy-header-indicator-display: inline-block,
header-indicator-display: none,
);
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
@return (
container-background-color: inspection.get-theme-color($theme, background, card),
container-text-color: inspection.get-theme-color($theme, foreground, text),
actions-divider-color: inspection.get-theme-color($theme, foreground, divider),
header-hover-state-layer-color: inspection.get-theme-color($theme, background, hover),
header-focus-state-layer-color: inspection.get-theme-color($theme, background, hover),
header-disabled-state-text-color: inspection.get-theme-color(
$theme, foreground, disabled-button),
header-text-color: inspection.get-theme-color($theme, foreground, text),
header-description-color: inspection.get-theme-color($theme, foreground, secondary-text),
header-indicator-color: inspection.get-theme-color($theme, foreground, secondary-text),
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return (
header-text-font: inspection.get-theme-typography($theme, subtitle-2, font-family),
header-text-size: inspection.get-theme-typography($theme, subtitle-2, font-size),
header-text-weight: inspection.get-theme-typography($theme, subtitle-2, font-weight),
// TODO(crisbeto): these two properties weren't set at all before the introduction of tokens,
// but it's inconsistent not to provide them since the container sets all of them. Eventually
// we should change the values to use come from `subtitle-2`.
header-text-line-height: inherit,
header-text-tracking: inherit,
container-text-font: inspection.get-theme-typography($theme, body-2, font-family),
container-text-line-height: inspection.get-theme-typography($theme, body-2, line-height),
container-text-size: inspection.get-theme-typography($theme, body-2, font-size),
container-text-tracking: inspection.get-theme-typography($theme, body-2, letter-spacing),
container-text-weight: inspection.get-theme-typography($theme, body-2, font-weight),
);
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
$scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
$collapsed-scale: (
0: 48px,
-1: 44px,
-2: 40px,
-3: 36px,
);
$expanded-scale: (
0: 64px,
-1: 60px,
-2: 56px,
-3: 48px,
);
@return (
header-collapsed-state-height: map.get($collapsed-scale, $scale),
header-expanded-state-height: map.get($expanded-scale, $scale),
);
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 3683,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_expansion.scss"
} |
components/src/material/core/tokens/m2/mat/_stepper.scss_0_5699 | @use 'sass:map';
@use '../../token-definition';
@use '../../../theming/theming';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, stepper);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return (
// Border radius for step header on focus
header-focus-state-layer-shape: 0,
// Border radius for step header on hover
header-hover-state-layer-shape: 0,
);
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
@return map.merge(private-get-color-palette-color-tokens($theme, primary), (
// Background for stepper container.
container-color: inspection.get-theme-color($theme, background, card),
// Color of the line indicator connecting the steps.
line-color: inspection.get-theme-color($theme, foreground, divider),
// Background color of the header while hovered.
header-hover-state-layer-color: inspection.get-theme-color($theme, background, hover),
// Background color of the header while focused.
header-focus-state-layer-color: inspection.get-theme-color($theme, background, hover),
// Color of the text inside the step header.
header-label-text-color: inspection.get-theme-color($theme, foreground, secondary-text),
// Color for the "optional" label in the step header.
header-optional-label-text-color: inspection.get-theme-color(
$theme, foreground, secondary-text),
// Color of the header text when a step is selected.
header-selected-state-label-text-color: inspection.get-theme-color($theme, foreground, text),
// Color of the header text when a step is in an error state.
header-error-state-label-text-color: inspection.get-theme-color($theme, warn, text),
// Background color of the header icon.
header-icon-background-color: inspection.get-theme-color($theme, foreground, secondary-text),
// Foreground color of the header icon in the error state.
header-error-state-icon-foreground-color: inspection.get-theme-color($theme, warn, text),
// Background color of the header icon in the error state.
header-error-state-icon-background-color: transparent,
));
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return (
// Font family of the entire stepper.
container-text-font: inspection.get-theme-typography($theme, body-2, font-family),
// Font family of the text inside the step header.
header-label-text-font: inspection.get-theme-typography($theme, body-2, font-family),
// Size of the text inside the step header.
header-label-text-size: inspection.get-theme-typography($theme, body-2, font-size),
// Weight of the text inside the step header.
header-label-text-weight: inspection.get-theme-typography($theme, body-2, font-weight),
// Color of the header text when a step is in an error state.
header-error-state-label-text-size: inspection.get-theme-typography($theme, body-1, font-size),
// Size of the header text in the selected state.
header-selected-state-label-text-size: inspection.get-theme-typography(
$theme, body-1, font-size),
// Weight of the header text in the selected state.
header-selected-state-label-text-weight: inspection.get-theme-typography(
$theme, body-1, font-weight),
);
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
$scale: theming.clamp-density(inspection.get-theme-density($theme), -4);
$height-config: (
0: 72px,
-1: 68px,
-2: 64px,
-3: 60px,
-4: 42px,
);
@return (
header-height: map.get($height-config, $scale),
);
}
// Generates the tokens used to theme the stepper based on a palette.
@function private-get-color-palette-color-tokens($theme, $palette-name) {
$active-state-foreground: inspection.get-theme-color($theme, $palette-name, default-contrast);
$active-state-background: inspection.get-theme-color($theme, $palette-name);
@return (
// Foreground color of the header icon.
header-icon-foreground-color: $active-state-foreground,
// Background color of the header icon in the selected state.
header-selected-state-icon-background-color: $active-state-background,
// Foreground color of the header icon in the selected state.
header-selected-state-icon-foreground-color: $active-state-foreground,
// Background color of the header icon in the selected state.
header-done-state-icon-background-color: $active-state-background,
// Foreground color of the header icon in the selected state.
header-done-state-icon-foreground-color: $active-state-foreground,
// Background color of the header icon in the editing state.
header-edit-state-icon-background-color: $active-state-background,
// Foreground color of the header icon in the editing state.
header-edit-state-icon-foreground-color: $active-state-foreground,
);
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 5699,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_stepper.scss"
} |
components/src/material/core/tokens/m2/mat/_checkbox.scss_0_2038 | @use '../../token-definition';
@use '../../../theming/theming';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, checkbox);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return ();
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
@return (
disabled-label-color: inspection.get-theme-color($theme, foreground, disabled-text),
label-text-color: inspection.get-theme-color($theme, foreground, text)
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return (
label-text-font: inspection.get-theme-typography($theme, body-2, font-family),
label-text-line-height: inspection.get-theme-typography($theme, body-2, line-height),
label-text-size: inspection.get-theme-typography($theme, body-2, font-size),
label-text-tracking: inspection.get-theme-typography($theme, body-2, letter-spacing),
label-text-weight: inspection.get-theme-typography($theme, body-2, font-weight)
);
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
$density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
@return (touch-target-display: if($density-scale < -1, none, block));
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 2038,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_checkbox.scss"
} |
components/src/material/core/tokens/m2/mat/_tab-header-with-background.scss_0_1492 | @use '../../token-definition';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, tab-header-with-background);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return ();
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme, $palette-name: primary) {
@return (
background-color: inspection.get-theme-color($theme, $palette-name, default),
foreground-color: inspection.get-theme-color($theme, $palette-name, default-contrast),
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return ();
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 1492,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_tab-header-with-background.scss"
} |
components/src/material/core/tokens/m2/mat/_sidenav.scss_0_2744 | @use 'sass:color';
@use 'sass:meta';
@use '../../token-definition';
@use '../../../theming/inspection';
@use '../../../style/elevation';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, sidenav);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return (
// Currently zero, but it appears to be relevant for M3.
// See: https://m3.material.io/components/navigation-drawer/overview
container-shape: 0,
container-elevation-shadow: elevation.get-box-shadow(16),
container-width: auto,
);
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
$is-dark: inspection.get-theme-type($theme) == dark;
$scrim-opacity: 0.6;
$scrim-color: sass-utils.safe-color-change(
inspection.get-theme-color($theme, background, card), $alpha: $scrim-opacity);
$fallback-scrim-color: if($is-dark, rgba(#fff, $scrim-opacity), rgba(#000, $scrim-opacity));
@return (
container-divider-color: inspection.get-theme-color($theme, foreground, divider),
container-background-color: inspection.get-theme-color($theme, background, dialog),
container-text-color: inspection.get-theme-color($theme, foreground, text),
content-background-color: inspection.get-theme-color($theme, background, background),
content-text-color: inspection.get-theme-color($theme, foreground, text),
// We use invert() here to have the darken the background color expected to be used.
// If the background is light, we use a dark backdrop. If the background is dark, we
// use a light backdrop. If the value isn't a color, Sass will throw an error so we
// fall back to something generic.
scrim-color: if(meta.type-of($scrim-color) == color,
color.invert($scrim-color), $fallback-scrim-color),
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return ();
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 2744,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_sidenav.scss"
} |
components/src/material/core/tokens/m2/mat/_badge.scss_0_4076 | @use 'sass:meta';
@use 'sass:map';
@use 'sass:math';
@use 'sass:color';
@use '../../token-definition';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
$_default-size: 22px;
$_small-size: $_default-size - 6px;
$_large-size: $_default-size + 6px;
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, badge);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
$default-size: $_default-size;
$small-size: $_small-size;
$large-size: $_large-size;
@return (
container-shape: 50%,
container-size: unset,
small-size-container-size: unset,
large-size-container-size: unset,
legacy-container-size: $default-size,
legacy-small-size-container-size: $small-size,
legacy-large-size-container-size: $large-size,
container-offset: math.div($default-size, -2) 0,
small-size-container-offset: math.div($small-size, -2) 0,
large-size-container-offset: math.div($large-size, -2) 0,
container-overlap-offset: math.div($default-size, -2),
small-size-container-overlap-offset: math.div($small-size, -2),
large-size-container-overlap-offset: math.div($large-size, -2),
container-padding: 0,
small-size-container-padding: 0,
large-size-container-padding: 0,
);
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
$primary-color-tokens: private-get-color-palette-color-tokens($theme, primary);
$app-background: inspection.get-theme-color($theme, background, background);
$disabled-background: inspection.get-theme-color($theme, foreground, disabled-button);
// The disabled color usually has some kind of opacity, but because the badge is overlayed
// on top of something else, it won't look good if it's opaque. If it is a color *type*,
// we convert it into a solid color by taking the opacity from the rgba value and using
// the value to determine the percentage of the background to put into foreground when
// mixing the colors together.
@if (meta.type-of($disabled-background) == color and meta.type-of($app-background) == color) {
$badge-opacity: opacity($disabled-background);
$disabled-background: color.mix($app-background,
rgba($disabled-background, 1), (1 - $badge-opacity) * 100%);
}
@return map.merge($primary-color-tokens, (
disabled-state-background-color: $disabled-background,
disabled-state-text-color: inspection.get-theme-color($theme, foreground, disabled-text),
));
}
// Generates the tokens used to theme the badge based on a palette.
@function private-get-color-palette-color-tokens($theme, $palette-name: primary) {
@return (
background-color: inspection.get-theme-color($theme, $palette-name),
text-color: inspection.get-theme-color($theme, $palette-name, default-contrast),
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
$base-size: 12px;
@return (
text-font: inspection.get-theme-typography($theme, body-2, font-family),
line-height: $_default-size,
text-size: $base-size,
text-weight: 600,
small-size-text-size: $base-size * 0.75,
small-size-line-height: $_small-size,
large-size-text-size: $base-size * 2,
large-size-line-height: $_large-size,
);
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return ();
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 4076,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_badge.scss"
} |
components/src/material/core/tokens/m2/mat/_protected-button.scss_0_3876 | @use 'sass:meta';
@use '../../token-definition';
@use '../../../theming/theming';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, protected-button);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return (
// Start/end padding of the button.
horizontal-padding: 16px,
// Space between the icon and the button's main content.
icon-spacing: 8px,
// Amount by which to offset the icon so that its presence
// doesn't increase throw off the horizontal padding.
icon-offset: -4px,
);
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
$is-dark: inspection.get-theme-type($theme) == dark;
@return (
// Color of the element that shows the hover, focus and pressed states.
state-layer-color: inspection.get-theme-color($theme, foreground, base),
// Color of the element that shows the hover, focus and pressed states while disabled.
disabled-state-layer-color: inspection.get-theme-color($theme, foreground, base),
// Color of the ripple element.
ripple-color: inspection.get-theme-color($theme, foreground, base, 0.1),
// Opacity of the ripple when the button is hovered.
hover-state-layer-opacity: if($is-dark, 0.08, 0.04),
// Opacity of the ripple when the button is focused.
focus-state-layer-opacity: if($is-dark, 0.24, 0.12),
// Opacity of the ripple when the button is pressed.
pressed-state-layer-opacity: if($is-dark, 0.24, 0.12),
);
}
// Generates the mapping for the properties that change based on the button palette color.
@function private-get-color-palette-color-tokens($theme, $palette-name) {
$state-layer-color: null;
$ripple-color: null;
$contrast-color: inspection.get-theme-color($theme, $palette-name, default-contrast);
// Ideally we would derive all values directly from the theme, but it causes a lot of regressions
// internally. For now we fall back to the old hardcoded behavior only for internal apps.
@if (token-definition.$private-is-internal-build or
meta.type-of($contrast-color) != 'color') {
$is-dark: inspection.get-theme-type($theme) == dark;
$container-color: inspection.get-theme-color($theme, $palette-name);
$contrast-tone: token-definition.contrast-tone($container-color, $is-dark);
$color: if($contrast-tone == 'dark', #000, #fff);
$state-layer-color: $color;
$ripple-color: rgba($color, 0.1);
}
@else {
$state-layer-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 1);
$ripple-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 0.1);
}
@return (
state-layer-color: $state-layer-color,
ripple-color: $ripple-color,
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
$density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
@return (
touch-target-display: if($density-scale < -1, none, block),
);
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 3876,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_protected-button.scss"
} |
components/src/material/core/tokens/m2/mat/_timepicker.scss_0_1486 | @use '../../token-definition';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
@use '../../../style/elevation';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, timepicker);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return (
container-shape: 4px,
container-elevation-shadow: elevation.get-box-shadow(8),
);
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
@return (
container-background-color: inspection.get-theme-color($theme, background, card)
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return ();
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 1486,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_timepicker.scss"
} |
components/src/material/core/tokens/m2/mat/_grid-list.scss_0_1919 | @use '../../token-definition';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, grid-list);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return ();
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return (
// TODO(crisbeto): other components have tokens for all typography dimensions.
// Here we only set the font size to maintain the same appearance as the pre-tokens
// theming API. Consider adding more tokens for letter spacing, font weight etc.
tile-header-primary-text-size: inspection.get-theme-typography($theme, body-2, font-size),
tile-header-secondary-text-size: inspection.get-theme-typography($theme, caption, font-size),
tile-footer-primary-text-size: inspection.get-theme-typography($theme, body-2, font-size),
tile-footer-secondary-text-size: inspection.get-theme-typography($theme, caption, font-size),
);
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return ();
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 1919,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_grid-list.scss"
} |
components/src/material/core/tokens/m2/mat/_option.scss_0_2233 | @use '../../token-definition';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, option);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return ();
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme, $palette-name: primary) {
$is-dark: inspection.get-theme-type($theme) == dark;
$active-state-layer-color: inspection.get-theme-color($theme, foreground, base,
if($is-dark, 0.08, 0.04));
@return (
selected-state-label-text-color: inspection.get-theme-color($theme, $palette-name),
label-text-color: inspection.get-theme-color($theme, foreground, text),
hover-state-layer-color: $active-state-layer-color,
focus-state-layer-color: $active-state-layer-color,
selected-state-layer-color: $active-state-layer-color,
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return (
label-text-font: inspection.get-theme-typography($theme, body-1, font-family),
label-text-line-height: inspection.get-theme-typography($theme, body-1, line-height),
label-text-size: inspection.get-theme-typography($theme, body-1, font-size),
label-text-tracking: inspection.get-theme-typography($theme, body-1, letter-spacing),
label-text-weight: inspection.get-theme-typography($theme, body-1, font-weight)
);
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return ();
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 2233,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_option.scss"
} |
components/src/material/core/tokens/m2/mat/_full-pseudo-checkbox.scss_0_1874 | @use '../../token-definition';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, full-pseudo-checkbox);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return ();
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme, $palette-name: accent) {
$is-dark: inspection.get-theme-type($theme) == dark;
$disabled-color: if($is-dark, #686868, #b0b0b0);
$checkmark-color: inspection.get-theme-color($theme, background, background);
@return (
selected-icon-color: inspection.get-theme-color($theme, $palette-name),
selected-checkmark-color: $checkmark-color,
unselected-icon-color: inspection.get-theme-color($theme, foreground, secondary-text),
disabled-selected-checkmark-color: $checkmark-color,
disabled-unselected-icon-color: $disabled-color,
disabled-selected-icon-color: $disabled-color,
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return ();
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 1874,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_full-pseudo-checkbox.scss"
} |
components/src/material/core/tokens/m2/mat/_radio.scss_0_2216 | @use '../../token-definition';
@use '../../../theming/theming';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, radio);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return ();
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme, $palette-name: accent) {
@return (
ripple-color: inspection.get-theme-color($theme, foreground, base),
checked-ripple-color: inspection.get-theme-color($theme, $palette-name, default),
disabled-label-color: inspection.get-theme-color($theme, foreground, disabled-text),
label-text-color: inspection.get-theme-color($theme, foreground, text)
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return (
label-text-font: inspection.get-theme-typography($theme, body-2, font-family),
label-text-line-height: inspection.get-theme-typography($theme, body-2, line-height),
label-text-size: inspection.get-theme-typography($theme, body-2, font-size),
label-text-tracking: inspection.get-theme-typography($theme, body-2, letter-spacing),
label-text-weight: inspection.get-theme-typography($theme, body-2, font-weight)
);
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
$density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
@return (touch-target-display: if($density-scale < -1, none, block));
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 2216,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_radio.scss"
} |
components/src/material/core/tokens/m2/mat/_chip.scss_0_2265 | @use 'sass:map';
@use '../../token-definition';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
@use '../../../m2/palette' as m2-palette;
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, chip);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return (
disabled-container-opacity: 0.4,
trailing-action-opacity: 0.54,
trailing-action-focus-opacity: 1,
trailing-action-state-layer-color: transparent,
selected-trailing-action-state-layer-color: transparent,
trailing-action-hover-state-layer-opacity: 0,
trailing-action-focus-state-layer-opacity: 0,
);
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme, $palette-name: null) {
$foreground: null;
@if $palette-name == null {
$is-dark: inspection.get-theme-type($theme) == dark;
$grey-50: map.get(m2-palette.$grey-palette, 50);
$grey-900: map.get(m2-palette.$grey-palette, 900);
$foreground: if($is-dark, $grey-50, $grey-900);
}
@else {
$foreground: inspection.get-theme-color($theme, $palette-name, default-contrast);
}
@return (
// The color of the icon at the end of a disabled chip.
selected-disabled-trailing-icon-color: $foreground,
// The color of the icon at the end of the chip.
selected-trailing-icon-color: $foreground
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return ();
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 2265,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_chip.scss"
} |
components/src/material/core/tokens/m2/mat/_text-button.scss_0_3204 | @use 'sass:meta';
@use '../../token-definition';
@use '../../../theming/theming';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, text-button);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return (
// Start/end padding of the button.
horizontal-padding: 8px,
// Start/end padding of the button when it has an icon.
with-icon-horizontal-padding: 8px,
// Space between the icon and the button's main content.
icon-spacing: 8px,
// Amount by which to offset the icon so that its presence
// doesn't increase throw off the horizontal padding.
icon-offset: 0,
);
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
$is-dark: inspection.get-theme-type($theme) == dark;
@return (
// Color of the element that shows the hover, focus and pressed states.
state-layer-color: inspection.get-theme-color($theme, foreground, base),
// Color of the element that shows the hover, focus and pressed states while disabled.
disabled-state-layer-color: inspection.get-theme-color($theme, foreground, base),
// Color of the ripple element.
ripple-color: inspection.get-theme-color($theme, foreground, base, 0.1),
// Opacity of the ripple when the button is hovered.
hover-state-layer-opacity: if($is-dark, 0.08, 0.04),
// Opacity of the ripple when the button is focused.
focus-state-layer-opacity: if($is-dark, 0.24, 0.12),
// Opacity of the ripple when the button is pressed.
pressed-state-layer-opacity: if($is-dark, 0.24, 0.12),
);
}
// Generates the mapping for the properties that change based on the button palette color.
@function private-get-color-palette-color-tokens($theme, $palette-name) {
$color: inspection.get-theme-color($theme, $palette-name);
$ripple-opacity: 0.1;
@return (
state-layer-color: $color,
ripple-color: if(
meta.type-of($color) == color,
rgba($color, $ripple-opacity),
inspection.get-theme-color($theme, foreground, base, $ripple-opacity)),
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
$density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
@return (
touch-target-display: if($density-scale < -1, none, block),
);
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 3204,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_text-button.scss"
} |
components/src/material/core/tokens/m2/mat/_datepicker.scss_0_8088 | @use 'sass:color';
@use 'sass:meta';
@use 'sass:math';
@use '../../token-definition';
@use '../../../theming/inspection';
@use '../../../style/elevation';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, datepicker);
$_selected-fade-amount: 0.6;
$_today-fade-amount: 0.2;
// Utility that produces a range background color from a specific color.
@function private-get-range-background-color($color) {
@return rgba($color, 0.2);
}
// Utility that produces the overlap selected color from an overlap color.
@function private-get-default-overlap-selected-color($overlap-color) {
@return color.adjust($overlap-color, $lightness: -30%);
}
// Default range comparison color.
$private-default-comparison-color: private-get-range-background-color(#f9ab00);
// Default range overlap color.
$private-default-overlap-color: #a8dab5;
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return (
calendar-container-shape: 4px,
calendar-container-touch-shape: 4px,
calendar-container-elevation-shadow: elevation.get-box-shadow(4),
calendar-container-touch-elevation-shadow: elevation.get-box-shadow(24),
);
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
$inactive-icon-color: inspection.get-theme-color($theme, foreground, icon);
$text-color: inspection.get-theme-color($theme, foreground, text);
$secondary-text-color: inspection.get-theme-color($theme, foreground, secondary-text);
$disabled-text-color: inspection.get-theme-color($theme, foreground, disabled-text);
$divider-color: inspection.get-theme-color($theme, foreground, divider);
$hint-text-color: inspection.get-theme-color($theme, foreground, hint-text);
$preview-outline-color: $divider-color;
$today-disabled-outline-color: null;
$is-dark: inspection.get-theme-type($theme) == dark;
$primary-color: inspection.get-theme-color($theme, primary);
$range-tokens: get-range-color-tokens(private-get-range-background-color($primary-color));
$calendar-tokens: private-get-calendar-color-palette-color-tokens($theme, primary);
$toggle-tokens: private-get-toggle-color-palette-color-tokens($theme, primary);
// The divider color is set under the assumption that it'll be used
// for a solid border, but because we're using a dashed border for the
// preview range, we need to bump its opacity to ensure that it's visible.
@if meta.type-of($preview-outline-color) == color {
$preview-outline-opacity: math.min(opacity($preview-outline-color) * 2, 1);
$preview-outline-color: rgba($preview-outline-color, $preview-outline-opacity);
}
@if (meta.type-of($hint-text-color) == color) {
$today-disabled-outline-color: color.adjust($hint-text-color, $alpha: -$_today-fade-amount);
}
@else {
$today-disabled-outline-color: $disabled-text-color;
}
@return sass-utils.merge-all($calendar-tokens, $toggle-tokens, $range-tokens, (
toggle-icon-color: $inactive-icon-color,
calendar-body-label-text-color: $secondary-text-color,
calendar-period-button-text-color: inspection.get-theme-color($theme, foreground, text, 1),
calendar-period-button-icon-color: $inactive-icon-color,
calendar-navigation-button-icon-color: $inactive-icon-color,
calendar-header-divider-color: $divider-color,
calendar-header-text-color: $secondary-text-color,
// Note: though it's not text, the border is a hint about the fact
// that this is today's date, so we use the hint color.
calendar-date-today-outline-color: $hint-text-color,
calendar-date-today-disabled-state-outline-color: $today-disabled-outline-color,
calendar-date-text-color: $text-color,
calendar-date-outline-color: transparent,
calendar-date-disabled-state-text-color: $disabled-text-color,
calendar-date-preview-state-outline-color: $preview-outline-color,
range-input-separator-color: $text-color,
range-input-disabled-state-separator-color: $disabled-text-color,
range-input-disabled-state-text-color: $disabled-text-color,
calendar-container-background-color: inspection.get-theme-color($theme, background, card),
calendar-container-text-color: $text-color,
));
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return (
// TODO(crisbeto): the typography tokens for other components set every typography dimension of
// an element (e.g. size, weight, line height, letter spacing). These tokens only set the values
// that were set in the previous theming API to reduce the amount of subtle screenshot
// differences. We should look into introducing the other tokens in a follow-up.
calendar-text-font: inspection.get-theme-typography($theme, body-1, font-family),
calendar-text-size: 13px,
calendar-body-label-text-size: inspection.get-theme-typography($theme, button, font-size),
calendar-body-label-text-weight: inspection.get-theme-typography($theme, button, font-weight),
calendar-period-button-text-size: inspection.get-theme-typography($theme, button, font-size),
calendar-period-button-text-weight: inspection.get-theme-typography(
$theme, button, font-weight),
calendar-header-text-size: 11px,
calendar-header-text-weight: inspection.get-theme-typography($theme, body-1, font-weight),
);
}
// Gets the tokens map that can be used to override the range colors.
@function get-range-color-tokens(
$range-color,
$comparison-color: $private-default-comparison-color,
$overlap-color: $private-default-overlap-color,
$overlap-selected-color: private-get-default-overlap-selected-color($overlap-color)) {
@return (
calendar-date-in-range-state-background-color: $range-color,
calendar-date-in-comparison-range-state-background-color: $comparison-color,
calendar-date-in-overlap-range-state-background-color: $overlap-color,
calendar-date-in-overlap-range-selected-state-background-color: $overlap-selected-color,
);
}
@function private-get-calendar-color-palette-color-tokens($theme, $palette-name) {
$palette-color: inspection.get-theme-color($theme, $palette-name);
$default-contrast: inspection.get-theme-color($theme, $palette-name, default-contrast);
$active-background-color: sass-utils.safe-color-change($palette-color, $alpha: 0.3);
$active-disabled-color: null;
@if (meta.type-of($palette-color) == color) {
$active-disabled-color: color.adjust($palette-color, $alpha: -$_selected-fade-amount);
}
@else {
$active-disabled-color: inspection.get-theme-color($theme, foreground, disabled-button);
}
@return (
calendar-date-selected-state-text-color: $default-contrast,
calendar-date-selected-state-background-color: $palette-color,
calendar-date-selected-disabled-state-background-color: $active-disabled-color,
calendar-date-today-selected-state-outline-color: $default-contrast,
calendar-date-focus-state-background-color: $active-background-color,
calendar-date-hover-state-background-color: $active-background-color,
);
}
@function private-get-toggle-color-palette-color-tokens($theme, $palette-name) {
@return (
toggle-active-state-icon-color: inspection.get-theme-color($theme, $palette-name, text),
);
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return ();
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 8088,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_datepicker.scss"
} |
components/src/material/core/tokens/m2/mat/_outlined-button.scss_0_3161 | @use 'sass:meta';
@use '../../token-definition';
@use '../../../theming/theming';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, outlined-button);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return (
// Start/end padding of the button.
horizontal-padding: 15px, // Normally it's 16px, but -1px for the outline.
// Space between the icon and the button's main content.
icon-spacing: 8px,
// Amount by which to offset the icon so that its presence
// doesn't increase throw off the horizontal padding.
icon-offset: -4px,
);
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
$is-dark: inspection.get-theme-type($theme) == dark;
@return (
// Color of the element that shows the hover, focus and pressed states.
state-layer-color: inspection.get-theme-color($theme, foreground, base),
// Color of the element that shows the hover, focus and pressed states while disabled.
disabled-state-layer-color: inspection.get-theme-color($theme, foreground, base),
// Color of the ripple element.
ripple-color: inspection.get-theme-color($theme, foreground, base, 0.1),
// Opacity of the ripple when the button is hovered.
hover-state-layer-opacity: if($is-dark, 0.08, 0.04),
// Opacity of the ripple when the button is focused.
focus-state-layer-opacity: if($is-dark, 0.24, 0.12),
// Opacity of the ripple when the button is pressed.
pressed-state-layer-opacity: if($is-dark, 0.24, 0.12),
);
}
// Generates the mapping for the properties that change based on the button palette color.
@function private-get-color-palette-color-tokens($theme, $palette-name) {
$color: inspection.get-theme-color($theme, $palette-name);
$ripple-opacity: 0.1;
@return (
state-layer-color: $color,
ripple-color: if(
meta.type-of($color) == color,
rgba($color, $ripple-opacity),
inspection.get-theme-color($theme, foreground, base, $ripple-opacity)),
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
$density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
@return (
touch-target-display: if($density-scale < -1, none, block),
);
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 3161,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_outlined-button.scss"
} |
components/src/material/core/tokens/m2/mat/_table.scss_0_3639 | @use 'sass:map';
@use '../../../theming/theming';
@use '../../../theming/inspection';
@use '../../token-definition';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, table);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return (
row-item-outline-width: 1px,
);
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
@return (
background-color: inspection.get-theme-color($theme, background, 'card'),
header-headline-color: inspection.get-theme-color($theme, foreground, text),
row-item-label-text-color: inspection.get-theme-color($theme, foreground, text),
row-item-outline-color: inspection.get-theme-color($theme, foreground, divider),
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
$cell-font-family: inspection.get-theme-typography($theme, body-2, font-family);
$cell-line-height: inspection.get-theme-typography($theme, body-2, line-height);
$cell-font-size: inspection.get-theme-typography($theme, body-2, font-size);
$cell-font-weight: inspection.get-theme-typography($theme, body-2, font-weight);
$cell-letter-spacing: inspection.get-theme-typography($theme, body-2, letter-spacing);
@return (
header-headline-font: inspection.get-theme-typography($theme, subtitle-2, font-family),
header-headline-line-height: inspection.get-theme-typography($theme, subtitle-2, line-height),
header-headline-size: inspection.get-theme-typography($theme, subtitle-2, font-size),
header-headline-weight: inspection.get-theme-typography($theme, subtitle-2, font-weight),
header-headline-tracking: inspection.get-theme-typography($theme, subtitle-2, letter-spacing),
// Plain cells and footer cells have the same typography.
row-item-label-text-font: $cell-font-family,
row-item-label-text-line-height: $cell-line-height,
row-item-label-text-size: $cell-font-size,
row-item-label-text-weight: $cell-font-weight,
row-item-label-text-tracking: $cell-letter-spacing,
footer-supporting-text-font: $cell-font-family,
footer-supporting-text-line-height: $cell-line-height,
footer-supporting-text-size: $cell-font-size,
footer-supporting-text-weight: $cell-font-weight,
footer-supporting-text-tracking: $cell-letter-spacing,
);
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
$scale: theming.clamp-density(inspection.get-theme-density($theme), -4);
$header-scale: (
0: 56px,
-1: 52px,
-2: 48px,
-3: 44px,
-4: 40px
);
$cell-scale: (
0: 52px,
-1: 48px,
-2: 44px,
-3: 40px,
-4: 36px
);
@return (
header-container-height: map.get($header-scale, $scale),
footer-container-height: map.get($cell-scale, $scale),
row-item-container-height: map.get($cell-scale, $scale),
);
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 3639,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_table.scss"
} |
components/src/material/core/tokens/m2/mat/_dialog.scss_0_1739 | @use '../../token-definition';
@use '../../../style/elevation';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, dialog);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return (
container-elevation-shadow: elevation.get-box-shadow(24),
container-max-width: 80vw,
container-small-max-width: 80vw,
container-min-width: 0,
actions-alignment: start,
actions-padding: 8px,
content-padding: 20px 24px,
with-actions-content-padding: 20px 24px,
// Note: the CSS class is `title` while the M2 tokens call it `subhead`.
// M3 calls it `headline` which is what we're aligning with.
headline-padding: 0 24px 9px,
);
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return ();
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 1739,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_dialog.scss"
} |
components/src/material/core/tokens/m2/mat/_bottom-sheet.scss_0_1968 | @use '../../token-definition';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, bottom-sheet);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return (
// TODO: will be necessary for M3.
container-shape: 4px,
);
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
@return (
container-text-color: inspection.get-theme-color($theme, foreground, text),
container-background-color: inspection.get-theme-color($theme, background, dialog),
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return (
container-text-font: inspection.get-theme-typography($theme, body-2, font-family),
container-text-line-height: inspection.get-theme-typography($theme, body-2, line-height),
container-text-size: inspection.get-theme-typography($theme, body-2, font-size),
container-text-tracking: inspection.get-theme-typography($theme, body-2, letter-spacing),
container-text-weight: inspection.get-theme-typography($theme, body-2, font-weight),
);
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return ();
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 1968,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_bottom-sheet.scss"
} |
components/src/material/core/tokens/m2/mat/_paginator.scss_0_3609 | @use 'sass:math';
@use 'sass:map';
@use '../../token-definition';
@use '../../../theming/theming';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, paginator);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return ();
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
$foreground-base: inspection.get-theme-color($theme, foreground, base);
@return (
container-text-color: sass-utils.safe-color-change($foreground-base, $alpha: 0.87),
container-background-color: inspection.get-theme-color($theme, background, card),
enabled-icon-color: sass-utils.safe-color-change($foreground-base, $alpha: 0.54),
disabled-icon-color: sass-utils.safe-color-change($foreground-base, $alpha: 0.12),
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return (
container-text-font: inspection.get-theme-typography($theme, caption, font-family),
container-text-line-height: inspection.get-theme-typography($theme, caption, line-height),
container-text-size: inspection.get-theme-typography($theme, caption, font-size),
container-text-tracking: inspection.get-theme-typography($theme, caption, letter-spacing),
container-text-weight: inspection.get-theme-typography($theme, caption, font-weight),
select-trigger-text-size: inspection.get-theme-typography($theme, caption, font-size),
);
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
$density-scale: theming.clamp-density(inspection.get-theme-density($theme), -5);
$size-scale: (
0: 56px,
-1: 52px,
-2: 48px,
-3: 40px,
-4: 40px,
-5: 40px,
);
$form-field-size-scale: (
0: 56px,
-1: 52px,
-2: 48px,
-3: 44px,
-4: 40px,
-5: 36px,
);
$form-field-density-scale: if($density-scale > -4, -4, $density-scale);
$form-field-height: map.get($form-field-size-scale, $form-field-density-scale);
// We computed the desired height of the form-field using the density configuration. The
// spec only describes vertical spacing/alignment in non-dense mode. This means that we
// cannot update the spacing to explicit numbers based on the density scale. Instead, we
// determine the height reduction and equally subtract it from the default `top` and `bottom`
// padding that is provided by the Material Design specification.
$form-field-vertical-deduction: math.div(56px - $form-field-height, 2);
$form-field-vertical-padding: 16px - $form-field-vertical-deduction;
@return (
container-size: map.get($size-scale, $density-scale),
form-field-container-height: $form-field-height,
form-field-container-vertical-padding: $form-field-vertical-padding,
touch-target-display: if($density-scale < -2, none, block),
);
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 3609,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_paginator.scss"
} |
components/src/material/core/tokens/m2/mat/_filled-button.scss_0_3873 | @use 'sass:meta';
@use '../../token-definition';
@use '../../../theming/theming';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, filled-button);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return (
// Start/end padding of the button.
horizontal-padding: 16px,
// Space between the icon and the button's main content.
icon-spacing: 8px,
// Amount by which to offset the icon so that its presence
// doesn't increase throw off the horizontal padding.
icon-offset: -4px,
);
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
$is-dark: inspection.get-theme-type($theme) == dark;
@return (
// Color of the element that shows the hover, focus and pressed states.
state-layer-color: inspection.get-theme-color($theme, foreground, base),
// Color of the element that shows the hover, focus and pressed states while disabled.
disabled-state-layer-color: inspection.get-theme-color($theme, foreground, base),
// Color of the ripple element.
ripple-color: inspection.get-theme-color($theme, foreground, base, 0.1),
// Opacity of the ripple when the button is hovered.
hover-state-layer-opacity: if($is-dark, 0.08, 0.04),
// Opacity of the ripple when the button is focused.
focus-state-layer-opacity: if($is-dark, 0.24, 0.12),
// Opacity of the ripple when the button is pressed.
pressed-state-layer-opacity: if($is-dark, 0.24, 0.12),
);
}
// Generates the mapping for the properties that change based on the button palette color.
@function private-get-color-palette-color-tokens($theme, $palette-name) {
$state-layer-color: null;
$ripple-color: null;
$contrast-color: inspection.get-theme-color($theme, $palette-name, default-contrast);
// Ideally we would derive all values directly from the theme, but it causes a lot of regressions
// internally. For now we fall back to the old hardcoded behavior only for internal apps.
@if (token-definition.$private-is-internal-build or
meta.type-of($contrast-color) != 'color') {
$is-dark: inspection.get-theme-type($theme) == dark;
$container-color: inspection.get-theme-color($theme, $palette-name);
$contrast-tone: token-definition.contrast-tone($container-color, $is-dark);
$color: if($contrast-tone == 'dark', #000, #fff);
$state-layer-color: $color;
$ripple-color: rgba($color, 0.1);
}
@else {
$state-layer-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 1);
$ripple-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 0.1);
}
@return (
state-layer-color: $state-layer-color,
ripple-color: $ripple-color,
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
$density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
@return (
touch-target-display: if($density-scale < -1, none, block),
);
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 3873,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_filled-button.scss"
} |
components/src/material/core/tokens/m2/mat/_list.scss_0_1444 | @use '../../token-definition';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, list);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return (
// active indicator themable with M3
active-indicator-color: transparent,
active-indicator-shape: 4px,
);
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return (
list-item-leading-icon-start-space: 16px,
list-item-leading-icon-end-space: 32px,
);
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 1444,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_list.scss"
} |
components/src/material/core/tokens/m2/mat/_ripple.scss_0_1745 | @use 'sass:meta';
@use '../../token-definition';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, ripple);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return ();
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
$is-dark: inspection.get-theme-type($theme) == dark;
$base: inspection.get-theme-color($theme, foreground, base);
// If the base is a color *type* we can use it directly in the `rgba` call below.
// If it's anything else (e.g. a CSS variable) we fall back to using static colors
// since we don't have a way of adjusting the opacity.
$color: if(meta.type-of($base) == color, $base, if($is-dark, #fff, #000));
@return (
color: rgba($color, 0.1),
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return ();
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 1745,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_ripple.scss"
} |
components/src/material/core/tokens/m2/mat/_legacy-button-toggle.scss_0_2501 | @use '../../token-definition';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, legacy-button-toggle);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return (
height: 36px,
shape: 2px,
focus-state-layer-opacity: 1,
);
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
@return (
text-color: inspection.get-theme-color($theme, foreground, hint-text),
state-layer-color: inspection.get-theme-color($theme, background, focused-button),
selected-state-text-color: inspection.get-theme-color($theme, foreground, secondary-text),
selected-state-background-color: inspection.get-theme-color(
$theme, background, selected-button),
disabled-state-text-color: inspection.get-theme-color($theme, foreground, disabled-button),
disabled-state-background-color: inspection.get-theme-color(
$theme, background, disabled-button-toggle),
disabled-selected-state-background-color: inspection.get-theme-color(
$theme, background, selected-disabled-button)
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return (
label-text-font: inspection.get-theme-typography($theme, body-1, font-family),
label-text-line-height: inspection.get-theme-typography($theme, body-1, line-height),
label-text-size: inspection.get-theme-typography($theme, body-1, font-size),
label-text-tracking: inspection.get-theme-typography($theme, body-1, letter-spacing),
label-text-weight: inspection.get-theme-typography($theme, body-1, font-weight),
);
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return ();
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 2501,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_legacy-button-toggle.scss"
} |
components/src/material/core/tokens/m2/mat/_app.scss_0_1812 | @use 'sass:map';
@use '../../token-definition';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
@use '../../../style/elevation';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, app);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return ();
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
$tokens: (
background-color: inspection.get-theme-color($theme, background, background),
text-color: inspection.get-theme-color($theme, foreground, text),
);
@for $zValue from 0 through 24 {
$elevation-color: inspection.get-theme-color($theme, foreground, elevation);
$shadow: elevation.get-box-shadow($zValue,
if($elevation-color == null, elevation.$color, $elevation-color));
$tokens: map.set($tokens, 'elevation-shadow-level-#{$zValue}', $shadow);
}
@return $tokens;
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return ();
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 1812,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_app.scss"
} |
components/src/material/core/tokens/m2/mat/_minimal-pseudo-checkbox.scss_0_1522 | @use '../../token-definition';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, minimal-pseudo-checkbox);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return ();
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme, $palette-name: accent) {
$is-dark: inspection.get-theme-type($theme) == dark;
@return (
selected-checkmark-color: inspection.get-theme-color($theme, $palette-name),
disabled-selected-checkmark-color: if($is-dark, #686868, #b0b0b0),
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return ();
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 1522,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_minimal-pseudo-checkbox.scss"
} |
components/src/material/core/tokens/m2/mat/_menu.scss_0_2805 | @use '../../token-definition';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, menu);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return (
container-shape: 4px,
divider-bottom-spacing: 0,
divider-top-spacing: 0,
item-spacing: 16px,
item-icon-size: 24px,
item-leading-spacing: 16px,
item-trailing-spacing: 16px,
item-with-icon-leading-spacing: 16px,
item-with-icon-trailing-spacing: 16px,
// Note that this uses a value, rather than a computed box-shadow, because we use
// the value at runtime to determine which shadow to set based on the menu's depth.
base-elevation-level: 8,
);
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
$is-dark: inspection.get-theme-type($theme) == dark;
$active-state-layer-color: inspection.get-theme-color($theme, foreground, base,
if($is-dark, 0.08, 0.04));
$text-color: inspection.get-theme-color($theme, foreground, text);
@return (
item-label-text-color: $text-color,
item-icon-color: $text-color,
item-hover-state-layer-color: $active-state-layer-color,
item-focus-state-layer-color: $active-state-layer-color,
container-color: inspection.get-theme-color($theme, background, card),
divider-color: inspection.get-theme-color($theme, foreground, divider),
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return (
item-label-text-font: inspection.get-theme-typography($theme, body-1, font-family),
item-label-text-size: inspection.get-theme-typography($theme, body-1, font-size),
item-label-text-tracking: inspection.get-theme-typography($theme, body-1, letter-spacing),
item-label-text-line-height: inspection.get-theme-typography($theme, body-1, line-height),
item-label-text-weight: inspection.get-theme-typography($theme, body-1, font-weight),
);
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return ();
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 2805,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_menu.scss"
} |
components/src/material/core/tokens/m2/mat/_card.scss_0_2736 | @use '../../token-definition';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, card);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return ();
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
@return (
// Text color of the card's subtitle.
subtitle-text-color: inspection.get-theme-color($theme, foreground, secondary-text),
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return (
// Font family of the card's title.
title-text-font: inspection.get-theme-typography($theme, headline-6, font-family),
// Line height of the card's title.
title-text-line-height: inspection.get-theme-typography($theme, headline-6, line-height),
// Font size of the card's title.
title-text-size: inspection.get-theme-typography($theme, headline-6, font-size),
// Letter spacing of the card's title.
title-text-tracking: inspection.get-theme-typography($theme, headline-6, letter-spacing),
// Font weight of the card's title.
title-text-weight: inspection.get-theme-typography($theme, headline-6, font-weight),
// Font family of the card's subtitle.
subtitle-text-font: inspection.get-theme-typography($theme, subtitle-2, font-family),
// Line height of the card's subtitle.
subtitle-text-line-height: inspection.get-theme-typography($theme, subtitle-2, line-height),
// Font size of the card's subtitle.
subtitle-text-size: inspection.get-theme-typography($theme, subtitle-2, font-size),
// Letter spacing of the card's subtitle.
subtitle-text-tracking: inspection.get-theme-typography($theme, subtitle-2, letter-spacing),
// Font weight of the card's subtitle.
subtitle-text-weight: inspection.get-theme-typography($theme, subtitle-2, font-weight),
);
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return ();
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 2736,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_card.scss"
} |
components/src/material/core/tokens/m2/mat/_snack-bar.scss_0_1444 | @use '../../token-definition';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, snack-bar);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return ();
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
$is-dark: inspection.get-theme-type($theme) == dark;
@return (
button-color: if(
$is-dark, rgba(0, 0, 0, 0.87), inspection.get-theme-color($theme, accent, text))
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return ();
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 1444,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_snack-bar.scss"
} |
components/src/material/core/tokens/m2/mat/_icon.scss_0_1477 | @use '../../token-definition';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, icon);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return ();
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
// Default the icon to `inherit` so it matches the text around it.
@return private-get-icon-color-tokens(inherit);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return ();
}
// Mixin used to set a specific color on an icon.
@function private-get-icon-color-tokens($color) {
@return (
color: $color,
);
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 1477,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_icon.scss"
} |
components/src/material/core/tokens/m2/mat/_slider.scss_0_2404 | @use 'sass:map';
@use '../../token-definition';
@use '../../../style/sass-utils';
@use '../../../theming/inspection';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, slider);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return (
value-indicator-width: auto,
value-indicator-height: 32px,
value-indicator-caret-display: block,
value-indicator-border-radius: 4px,
value-indicator-padding: 0 12px,
value-indicator-text-transform: none,
value-indicator-container-transform: translateX(-50%)
);
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
$theme-color-tokens: private-get-color-palette-color-tokens($theme, primary);
$is-dark: inspection.get-theme-type($theme) == dark;
@return map.merge(
$theme-color-tokens,
(
// Opacity of value indicator text container
value-indicator-opacity: if($is-dark, 0.9, 0.6)
),
);
}
// Generates tokens for the slider properties that change based on the theme.
@function private-get-color-palette-color-tokens($theme, $palette-name) {
$ripple-color: inspection.get-theme-color($theme, $palette-name);
$hover-ripple-color: if($ripple-color == null, null, #{rgba($ripple-color, 0.05)});
$focus-ripple-color: if($ripple-color == null, null, #{rgba($ripple-color, 0.2)});
@return (
ripple-color: $ripple-color,
hover-state-layer-color: $hover-ripple-color,
focus-state-layer-color: $focus-ripple-color
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return ();
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 2404,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_slider.scss"
} |
components/src/material/core/tokens/m2/mat/_standard-button-toggle.scss_0_3641 | @use 'sass:map';
@use 'sass:meta';
@use '../../token-definition';
@use '../../../theming/theming';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, standard-button-toggle);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return (
shape: 4px,
hover-state-layer-opacity: 0.04,
focus-state-layer-opacity: 0.12,
);
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
$theme-divider-color: inspection.get-theme-color($theme, foreground, divider);
// By default the theme usually has an rgba color for the dividers, which can
// stack up with the background of a button toggle. This can cause the border
// of a selected toggle to look different from an unselected one. We use a solid
// color to ensure that the border always stays the same.
$divider-color: if(
meta.type-of($theme-divider-color) == color,
theming.private-rgba-to-hex(
$theme-divider-color, inspection.get-theme-color($theme, background, card)),
$theme-divider-color);
@return (
text-color: inspection.get-theme-color($theme, foreground, text),
background-color: inspection.get-theme-color($theme, background, card),
state-layer-color: sass-utils.safe-color-change(
inspection.get-theme-color($theme, background, focused-button), $alpha: 1),
selected-state-background-color: inspection.get-theme-color(
$theme, background, selected-button),
selected-state-text-color: inspection.get-theme-color($theme, foreground, text),
disabled-state-text-color: inspection.get-theme-color($theme, foreground, disabled-button),
disabled-state-background-color: inspection.get-theme-color($theme, background, card),
disabled-selected-state-text-color: inspection.get-theme-color($theme, foreground, text),
disabled-selected-state-background-color:
inspection.get-theme-color($theme, background, selected-disabled-button),
divider-color: $divider-color,
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return (
label-text-font: inspection.get-theme-typography($theme, body-1, font-family),
label-text-line-height: inspection.get-theme-typography($theme, body-1, line-height),
label-text-size: inspection.get-theme-typography($theme, body-1, font-size),
label-text-tracking: inspection.get-theme-typography($theme, body-1, letter-spacing),
label-text-weight: inspection.get-theme-typography($theme, body-1, font-weight),
);
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
$density-scale: theming.clamp-density(inspection.get-theme-density($theme), -4);
$size-scale: (
0: 48px,
-1: 44px,
-2: 40px,
-3: 36px,
-4: 24px,
);
@return (
height: map.get($size-scale, $density-scale)
);
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 3641,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_standard-button-toggle.scss"
} |
components/src/material/core/tokens/m2/mat/_sort.scss_0_2323 | @use 'sass:color';
@use 'sass:meta';
@use '../../token-definition';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, sort);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return ();
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
$table-background: inspection.get-theme-color($theme, background, card);
$text-color: inspection.get-theme-color($theme, foreground, secondary-text);
$arrow-color: null;
// Because the arrow is made up of multiple elements that are stacked on top of each other,
// we can't use the semi-transparent color from the theme directly. If the value is a color
// *type*, we convert it into a solid color by taking the opacity from the rgba value and
// using the value to determine the percentage of the background to put into foreground
// when mixing the colors together. Otherwise, if it resolves to something different
// (e.g. it resolves to a CSS variable), we use the color directly.
@if (meta.type-of($table-background) == color and meta.type-of($text-color) == color) {
$text-opacity: opacity($text-color);
$arrow-color: color.mix($table-background, rgba($text-color, 1), (1 - $text-opacity) * 100%);
}
@else {
$arrow-color: $text-color;
}
@return (
arrow-color: $arrow-color,
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return ();
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 2323,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_sort.scss"
} |
components/src/material/core/tokens/m2/mat/_fab-small.scss_0_4364 | @use 'sass:meta';
@use '../../token-definition';
@use '../../../theming/theming';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, fab-small);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return ();
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
$is-dark: inspection.get-theme-type($theme) == dark;
@return (
// Color of icons and text projected into a FAB.
foreground-color: inspection.get-theme-color($theme, foreground, base),
// Color of the element that shows the hover, focus and pressed states.
state-layer-color: inspection.get-theme-color($theme, foreground, base),
// Color of the element that shows the hover, focus and pressed states while disabled.
disabled-state-layer-color: inspection.get-theme-color($theme, foreground, base),
// Color of the ripple element.
ripple-color: inspection.get-theme-color($theme, foreground, base, 0.1),
// Opacity of the ripple when the button is hovered.
hover-state-layer-opacity: if($is-dark, 0.08, 0.04),
// Opacity of the ripple when the button is focused.
focus-state-layer-opacity: if($is-dark, 0.24, 0.12),
// Opacity of the ripple when the button is pressed.
pressed-state-layer-opacity: if($is-dark, 0.24, 0.12),
// MDC doesn't have tokens for disabled FABs so we need to implemented them ourselves.
// Background color of the container when the FAB is disabled.
disabled-state-container-color: inspection.get-theme-color($theme, background, disabled-button,
0.12),
// Color of the icons and projected text when the FAB is disabled.
disabled-state-foreground-color: inspection.get-theme-color($theme, foreground, disabled-button,
if($is-dark, 0.5, 0.38)),
);
}
// Generates the mapping for the properties that change based on the FAB palette color.
@function private-get-color-palette-color-tokens($theme, $palette-name) {
// Ideally we would derive all values directly from the theme, but it causes a lot of regressions
// internally. For now we fall back to the old hardcoded behavior only for internal apps.
$foreground-color: null;
$state-layer-color: null;
$ripple-color: null;
$contrast-color: inspection.get-theme-color($theme, $palette-name, default-contrast);
@if (token-definition.$private-is-internal-build or
meta.type-of($contrast-color) != 'color') {
$is-dark: inspection.get-theme-type($theme) == dark;
$container-color: inspection.get-theme-color($theme, $palette-name);
$contrast-tone: token-definition.contrast-tone($container-color, $is-dark);
$color: if($contrast-tone == 'dark', #000, #fff);
$foreground-color: $color;
$state-layer-color: $color;
$ripple-color: rgba($color, 0.1);
}
@else {
$foreground-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 1);
$state-layer-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 1);
$ripple-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 0.1);
}
@return (
foreground-color: $foreground-color,
state-layer-color: $state-layer-color,
ripple-color: $ripple-color,
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
$density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
@return (
touch-target-display: if($density-scale < -1, none, block),
);
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 4364,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_fab-small.scss"
} |
components/src/material/core/tokens/m2/mat/_autocomplete.scss_0_1478 | @use '../../token-definition';
@use '../../../theming/inspection';
@use '../../../style/elevation';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, autocomplete);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return (
container-shape: 4px,
container-elevation-shadow: elevation.get-box-shadow(8),
);
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
@return (
background-color: inspection.get-theme-color($theme, background, card)
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return ();
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 1478,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_autocomplete.scss"
} |
components/src/material/core/tokens/m2/mat/_icon-button.scss_0_2805 | @use 'sass:meta';
@use '../../token-definition';
@use '../../../theming/theming';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, icon-button);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return ();
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
$is-dark: inspection.get-theme-type($theme) == dark;
@return (
// Color of the element that shows the hover, focus and pressed states.
state-layer-color: inspection.get-theme-color($theme, foreground, base),
// Color of the element that shows the hover, focus and pressed states while disabled.
disabled-state-layer-color: inspection.get-theme-color($theme, foreground, base),
// Color of the ripple element.
ripple-color: inspection.get-theme-color($theme, foreground, base, 0.1),
// Opacity of the ripple when the button is hovered.
hover-state-layer-opacity: if($is-dark, 0.08, 0.04),
// Opacity of the ripple when the button is focused.
focus-state-layer-opacity: if($is-dark, 0.24, 0.12),
// Opacity of the ripple when the button is pressed.
pressed-state-layer-opacity: if($is-dark, 0.24, 0.12),
);
}
// Generates the mapping for the properties that change based on the button palette color.
@function private-get-color-palette-color-tokens($theme, $palette-name) {
$color: inspection.get-theme-color($theme, $palette-name);
$ripple-opacity: 0.1;
@return (
state-layer-color: $color,
ripple-color: if(
meta.type-of($color) == color,
rgba($color, $ripple-opacity),
inspection.get-theme-color($theme, foreground, base, $ripple-opacity)),
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
$density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
@return (
touch-target-display: if($density-scale < -1, none, block),
);
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 2805,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_icon-button.scss"
} |
components/src/material/core/tokens/m2/mat/_tree.scss_0_2156 | @use 'sass:map';
@use '../../token-definition';
@use '../../../theming/theming';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, tree);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return ();
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
$foreground-base: inspection.get-theme-color($theme, foreground, base);
@return (
container-background-color: inspection.get-theme-color($theme, background, card),
node-text-color: inspection.get-theme-color($theme, foreground, text),
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return (
node-text-font: inspection.get-theme-typography($theme, body-2, font-family),
node-text-size: inspection.get-theme-typography($theme, body-2, font-size),
node-text-weight: inspection.get-theme-typography($theme, body-2, font-weight),
// TODO(crisbeto): provide tokens for line height and letter spacing to match other components.
);
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
$density-scale: theming.clamp-density(inspection.get-theme-density($theme), -4);
$min-height-scale: (
0: 48px,
-1: 44px,
-2: 40px,
-3: 36px,
-4: 28px,
);
@return (
node-min-height: map.get($min-height-scale, $density-scale)
);
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 2156,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_tree.scss"
} |
components/src/material/core/tokens/m2/mat/_fab.scss_0_4358 | @use 'sass:meta';
@use '../../token-definition';
@use '../../../theming/theming';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, fab);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return ();
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
$is-dark: inspection.get-theme-type($theme) == dark;
@return (
// Color of icons and text projected into a FAB.
foreground-color: inspection.get-theme-color($theme, foreground, base),
// Color of the element that shows the hover, focus and pressed states.
state-layer-color: inspection.get-theme-color($theme, foreground, base),
// Color of the element that shows the hover, focus and pressed states while disabled.
disabled-state-layer-color: inspection.get-theme-color($theme, foreground, base),
// Color of the ripple element.
ripple-color: inspection.get-theme-color($theme, foreground, base, 0.1),
// Opacity of the ripple when the button is hovered.
hover-state-layer-opacity: if($is-dark, 0.08, 0.04),
// Opacity of the ripple when the button is focused.
focus-state-layer-opacity: if($is-dark, 0.24, 0.12),
// Opacity of the ripple when the button is pressed.
pressed-state-layer-opacity: if($is-dark, 0.24, 0.12),
// MDC doesn't have tokens for disabled FABs so we need to implemented them ourselves.
// Background color of the container when the FAB is disabled.
disabled-state-container-color: inspection.get-theme-color($theme, background, disabled-button,
0.12),
// Color of the icons and projected text when the FAB is disabled.
disabled-state-foreground-color: inspection.get-theme-color($theme, foreground, disabled-button,
if($is-dark, 0.5, 0.38)),
);
}
// Generates the mapping for the properties that change based on the FAB palette color.
@function private-get-color-palette-color-tokens($theme, $palette-name) {
// Ideally we would derive all values directly from the theme, but it causes a lot of regressions
// internally. For now we fall back to the old hardcoded behavior only for internal apps.
$foreground-color: null;
$state-layer-color: null;
$ripple-color: null;
$contrast-color: inspection.get-theme-color($theme, $palette-name, default-contrast);
@if (token-definition.$private-is-internal-build or
meta.type-of($contrast-color) != 'color') {
$is-dark: inspection.get-theme-type($theme) == dark;
$container-color: inspection.get-theme-color($theme, $palette-name);
$contrast-tone: token-definition.contrast-tone($container-color, $is-dark);
$color: if($contrast-tone == 'dark', #000, #fff);
$foreground-color: $color;
$state-layer-color: $color;
$ripple-color: rgba($color, 0.1);
}
@else {
$foreground-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 1);
$state-layer-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 1);
$ripple-color: inspection.get-theme-color($theme, $palette-name, default-contrast, 0.1);
}
@return (
foreground-color: $foreground-color,
state-layer-color: $state-layer-color,
ripple-color: $ripple-color,
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
$density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
@return (
touch-target-display: if($density-scale < -1, none, block),
);
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 4358,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_fab.scss"
} |
components/src/material/core/tokens/m2/mat/_toolbar.scss_0_2599 | @use 'sass:map';
@use '../../token-definition';
@use '../../../theming/theming';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, toolbar);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return ();
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
@return private-get-color-palette-color-tokens(
$background-color: inspection.get-theme-color($theme, background, app-bar),
$text-color: inspection.get-theme-color($theme, foreground, text),
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return (
title-text-font: inspection.get-theme-typography($theme, headline-6, font-family),
title-text-line-height: inspection.get-theme-typography($theme, headline-6, line-height),
title-text-size: inspection.get-theme-typography($theme, headline-6, font-size),
title-text-tracking: inspection.get-theme-typography($theme, headline-6, letter-spacing),
title-text-weight: inspection.get-theme-typography($theme, headline-6, font-weight),
);
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
$density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
$standard-scale: (
0: 64px,
-1: 60px,
-2: 56px,
-3: 52px,
);
$mobile-scale: (
0: 56px,
-1: 52px,
-2: 48px,
-3: 44px,
);
@return (
standard-height: map.get($standard-scale, $density-scale),
mobile-height: map.get($mobile-scale, $density-scale),
);
}
// Generates the tokens used to theme the toolbar based on a palette.
@function private-get-color-palette-color-tokens($background-color, $text-color) {
@return (
container-background-color: $background-color,
container-text-color: $text-color,
);
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 2599,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_toolbar.scss"
} |
components/src/material/core/tokens/m2/mat/_switch.scss_0_3104 | @use '../../token-definition';
@use '../../../style/sass-utils';
@use '../../../theming/inspection';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, switch);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return (
disabled-selected-handle-opacity: 0.38,
disabled-unselected-handle-opacity: 0.38,
unselected-handle-size: 20px,
selected-handle-size: 20px,
pressed-handle-size: 20px,
with-icon-handle-size: 20px,
selected-handle-horizontal-margin: 0,
selected-with-icon-handle-horizontal-margin: 0,
selected-pressed-handle-horizontal-margin: 0,
unselected-handle-horizontal-margin: 0,
unselected-with-icon-handle-horizontal-margin: 0,
unselected-pressed-handle-horizontal-margin: 0,
// The hidden and visible track represent whichever track is visible or
// hidden in the ui. This could be the .mdc-switch__track :before or
// :after depending on whether the switch is selected or unselected.
//
// The m2 slide-toggle uses transforms to hide & show the tracks while
// the m3 slide-toggle uses opacity.
visible-track-opacity: 1,
hidden-track-opacity: 1,
visible-track-transition: transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1),
hidden-track-transition: transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1),
track-outline-width: 1px,
track-outline-color: transparent,
selected-track-outline-width: 1px,
selected-track-outline-color: transparent,
disabled-unselected-track-outline-width: 1px,
disabled-unselected-track-outline-color: transparent
);
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
@return (label-text-color: inspection.get-theme-color($theme, foreground, text));
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return (
label-text-font: inspection.get-theme-typography($theme, body-2, font-family),
label-text-line-height: inspection.get-theme-typography($theme, body-2, line-height),
label-text-size: inspection.get-theme-typography($theme, body-2, font-size),
label-text-tracking: inspection.get-theme-typography($theme, body-2, letter-spacing),
label-text-weight: inspection.get-theme-typography($theme, body-2, font-weight)
);
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return ();
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 3104,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_switch.scss"
} |
components/src/material/core/tokens/m2/mat/_divider.scss_0_1352 | @use '../../token-definition';
@use '../../../theming/inspection';
@use '../../../style/sass-utils';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, divider);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return (
width: 1px
);
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
@return (
color: inspection.get-theme-color($theme, foreground, divider)
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return ();
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($theme) {
@return ();
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
}
| {
"end_byte": 1352,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_divider.scss"
} |
components/src/material/core/tokens/m2/mat/_form-field.scss_0_5388 | @use 'sass:math';
@use 'sass:map';
@use '../../token-definition';
@use '../../../style/sass-utils';
@use '../../../theming/theming';
@use '../../../theming/inspection';
@use '../../../m2/palette' as m2-palette;
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, form-field);
// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
@function get-unthemable-tokens() {
@return ();
}
// Tokens that can be configured through Angular Material's color theming API.
@function get-color-tokens($theme) {
$is-dark: inspection.get-theme-type($theme) == dark;
$color-tokens: private-get-color-palette-color-tokens($theme, primary);
@return map.merge($color-tokens, (
// MDC has a token for the enabled placeholder, but not for the disabled one.
disabled-input-text-placeholder-color:
inspection.get-theme-color($theme, foreground, icon, 0.38),
state-layer-color: inspection.get-theme-color($theme, foreground, base, 0.87),
error-text-color: inspection.get-theme-color($theme, warn),
// On dark themes we set the native `select` color to some shade of white,
// however the color propagates to all of the `option` elements, which are
// always on a white background inside the dropdown, causing them to blend in.
// Since we can't change background of the dropdown, we need to explicitly
// reset the color of the options to something dark.
select-option-text-color: if($is-dark, m2-palette.$dark-primary-text, inherit),
// Note the spelling of the `GrayText` here which is a system color. See:
// https://developer.mozilla.org/en-US/docs/Web/CSS/system-color
select-disabled-option-text-color: if($is-dark, m2-palette.$dark-disabled-text, GrayText),
// These tokens are necessary for M3. MDC has them built in already, but:
// 1. They are too specific, breaking a lot of internal clients.
// 2. The larger selectors result in a larger bundle.
// Note: MDC has tokens for all the various states of the icons. Some of them are ommitted,
// because they resolve to the same value (e.g. focus and base states for the leading icon
// are the same).
leading-icon-color: unset,
disabled-leading-icon-color: unset,
trailing-icon-color: unset,
disabled-trailing-icon-color: unset,
error-focus-trailing-icon-color: unset,
error-hover-trailing-icon-color: unset,
error-trailing-icon-color: unset,
enabled-select-arrow-color: inspection.get-theme-color($theme, foreground, icon, 0.54),
disabled-select-arrow-color: inspection.get-theme-color($theme, foreground, icon, 0.38),
hover-state-layer-opacity: if($is-dark, 0.08, 0.04),
focus-state-layer-opacity: if($is-dark, 0.24, 0.08),
));
}
// Generates the mapping for the properties that change based on the form field color.
@function private-get-color-palette-color-tokens($theme, $palette-name) {
$palette-color: inspection.get-theme-color($theme, $palette-name);
@return (
focus-select-arrow-color: sass-utils.safe-color-change($palette-color, $alpha: 0.87),
);
}
// Tokens that can be configured through Angular Material's typography theming API.
@function get-typography-tokens($theme) {
@return (
// MDC uses `subtitle1` for the input value, placeholder and floating label. The spec
// shows `body1` for text fields though, so we manually override the typography.
// Note: Form controls inherit the typography from the parent form field.
container-text-font: inspection.get-theme-typography($theme, body-1, font-family),
container-text-line-height: inspection.get-theme-typography($theme, body-1, line-height),
container-text-size: inspection.get-theme-typography($theme, body-1, font-size),
container-text-tracking: inspection.get-theme-typography($theme, body-1, letter-spacing),
container-text-weight: inspection.get-theme-typography($theme, body-1, font-weight),
// In the container styles, we updated the floating label to use the `body-1` typography level.
// The MDC notched outline overrides this accidentally (only when the label floats) to a
// `rem`-based value. This results in different label widths when floated/docked and ultimately
// breaks the notch width as it has been measured in the docked state (where `body-1` is
// applied). We try to unset these styles set by the `mdc-notched-outline`:
// https://github.com/material-components/material-components-web/blob/master/packages/mdc-notched-outline/_mixins.scss#L272-L292.
// This is why we can't use their `label-text-populated-size` token and we have to declare
// our own version of it.
outlined-label-text-populated-size: inspection.get-theme-typography($theme, body-1, font-size),
subscript-text-font: inspection.get-theme-typography($theme, caption, font-family),
subscript-text-line-height: inspection.get-theme-typography($theme, caption, line-height),
subscript-text-size: inspection.get-theme-typography($theme, caption, font-size),
subscript-text-tracking: inspection.get-theme-typography($theme, caption, letter-spacing),
subscript-text-weight: inspection.get-theme-typography($theme, caption, font-weight),
);
}
// Tokens that can be configured through Angular Material's density theming API. | {
"end_byte": 5388,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_form-field.scss"
} |
components/src/material/core/tokens/m2/mat/_form-field.scss_5389_8769 | @function get-density-tokens($theme) {
$density-scale: theming.clamp-density(inspection.get-theme-density($theme), -5);
$size-scale: (
0: 56px,
-1: 52px,
-2: 48px,
-3: 44px,
-4: 40px,
-5: 36px,
);
$height: map.get($size-scale, $density-scale);
$hide-label: $height < 52px;
// We computed the desired height of the form-field using the density configuration. The
// spec only describes vertical spacing/alignment in non-dense mode. This means that we
// cannot update the spacing to explicit numbers based on the density scale. Instead, we
// determine the height reduction and equally subtract it from the default `top` and `bottom`
// padding that is provided by the Material Design specification.
$vertical-deduction: math.div(56px - $height, 2);
// Note: these calculations are trivial enough that we could do them at runtime with `calc`
// and the value of the `height` token. The problem is that because we need to hide the label
// if the container becomes too short, we have to change the padding calculation. This is
// complicated further by the fact that filled form fields without labels have the same
// vertical padding as outlined ones. Alternatives:
// 1. Using container queries to hide the label and change the padding - this doesn't work
// because size container queries require setting the `container-type` property which breaks
// the form field layout. We could use style queries, but they're only supported in Chrome.
// 2. Monitoring the size of the label - we already have a `ResizeObserver` on the label so we
// could reuse it to also check when it becomes `display: none`. This would allows us to remove
// the three padding tokens. We don't do it, because it would require us to always set up
// the resize observer, as opposed to currently where it's only set up for outlined form fields.
// This may lead to performance regressions.
// 3. Conditionally adding `::before` and `::after` to the infix with positive and negative
// margin respectively - this works, but is likely to break a lot of overrides that are targeting
// a specific padding. It also runs the risk of overflowing the container.
// TODO: switch the padding tokens to style-based container queries
// when they become available in all the browsers we support.
$filled-with-label-padding-top: 24px - $vertical-deduction;
$filled-with-label-padding-bottom: 8px - $vertical-deduction;
$vertical-padding: 16px - $vertical-deduction;
@return (
container-height: $height,
filled-label-display: if($hide-label, none, block),
container-vertical-padding: $vertical-padding,
filled-with-label-container-padding-top:
if($hide-label, $vertical-padding, $filled-with-label-padding-top),
filled-with-label-container-padding-bottom:
if($hide-label, $vertical-padding, $filled-with-label-padding-bottom),
);
}
// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(token-definition.$placeholder-color-config),
get-typography-tokens(token-definition.$placeholder-typography-config),
get-density-tokens(token-definition.$placeholder-density-config)
);
} | {
"end_byte": 8769,
"start_byte": 5389,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m2/mat/_form-field.scss"
} |
components/src/material/core/tokens/m3/_index.scss_0_5727 | @use 'sass:meta';
@use 'sass:map';
@use './mat/app' as tokens-mat-app;
@use './mat/autocomplete' as tokens-mat-autocomplete;
@use './mat/badge' as tokens-mat-badge;
@use './mat/text-button' as tokens-mat-text-button;
@use './mat/protected-button' as tokens-mat-protected-button;
@use './mat/filled-button' as tokens-mat-filled-button;
@use './mat/outlined-button' as tokens-mat-outlined-button;
@use './mat/dialog' as tokens-mat-dialog;
@use './mat/bottom-sheet' as tokens-mat-bottom-sheet;
@use './mat/card' as tokens-mat-card;
@use './mat/chip' as tokens-mat-chip;
@use './mat/datepicker' as tokens-mat-datepicker;
@use './mat/divider' as tokens-mat-divider;
@use './mat/expansion' as tokens-mat-expansion;
@use './mat/fab' as tokens-mat-fab;
@use './mat/fab-small' as tokens-mat-fab-small;
@use './mat/form-field' as tokens-mat-form-field;
@use './mat/grid-list' as tokens-mat-grid-list;
@use './mat/icon' as tokens-mat-icon;
@use './mat/icon-button' as tokens-mat-icon-button;
@use './mat/list' as tokens-mat-list;
@use './mat/menu' as tokens-mat-menu;
@use './mat/option' as tokens-mat-option;
@use './mat/optgroup' as tokens-mat-optgroup;
@use './mat/paginator' as tokens-mat-paginator;
@use './mat/checkbox' as tokens-mat-checkbox;
@use './mat/full-pseudo-checkbox' as tokens-mat-full-pseudo-checkbox;
@use './mat/minimal-pseudo-checkbox' as tokens-mat-minimal-pseudo-checkbox;
@use './mat/radio' as tokens-mat-radio;
@use './mat/ripple' as tokens-mat-ripple;
@use './mat/select' as tokens-mat-select;
@use './mat/sidenav' as tokens-mat-sidenav;
@use './mat/slider' as tokens-mat-slider;
@use './mat/switch' as tokens-mat-switch;
@use './mat/snack-bar' as tokens-mat-snack-bar;
@use './mat/sort' as tokens-mat-sort;
@use './mat/standard-button-toggle' as tokens-mat-button-toggle;
@use './mat/stepper' as tokens-mat-stepper;
@use './mat/tab-header' as tokens-mat-tab-header;
@use './mat/table' as tokens-mat-table;
@use './mat/toolbar' as tokens-mat-toolbar;
@use './mat/tree' as tokens-mat-tree;
@use './mat/timepicker' as tokens-mat-timepicker;
@use './mdc/checkbox' as tokens-mdc-checkbox;
@use './mdc/text-button' as tokens-mdc-text-button;
@use './mdc/protected-button' as tokens-mdc-protected-button;
@use './mdc/filled-button' as tokens-mdc-filled-button;
@use './mdc/outlined-button' as tokens-mdc-outlined-button;
@use './mdc/chip' as tokens-mdc-chip;
@use './mdc/circular-progress' as tokens-mdc-circular-progress;
@use './mdc/dialog' as tokens-mdc-dialog;
@use './mdc/elevated-card' as tokens-mdc-elevated-card;
@use './mdc/extended-fab' as tokens-mdc-extended-fab;
@use './mdc/fab' as tokens-mdc-fab;
@use './mdc/fab-small' as tokens-mdc-fab-small;
@use './mdc/filled-text-field' as tokens-mdc-filled-text-field;
@use './mdc/icon-button' as tokens-mdc-icon-button;
@use './mdc/linear-progress' as tokens-mdc-linear-progress;
@use './mdc/list' as tokens-mdc-list;
@use './mdc/outlined-card' as tokens-mdc-outlined-card;
@use './mdc/outlined-text-field' as tokens-mdc-outlined-text-field;
@use './mdc/plain-tooltip' as tokens-mdc-plain-tooltip;
@use './mdc/radio' as tokens-mdc-radio;
@use './mdc/slider' as tokens-mdc-slider;
@use './mdc/snack-bar' as tokens-mdc-snack-bar;
@use './mdc/switch' as tokens-mdc-switch;
@use './mdc/secondary-navigation-tab' as tokens-mdc-secondary-navigation-tab;
@use './mdc/tab-indicator' as tokens-mdc-tab-indicator;
$_module-names: (
// Custom tokens
tokens-mat-app,
tokens-mat-autocomplete,
tokens-mat-badge,
tokens-mat-bottom-sheet,
tokens-mat-button-toggle,
tokens-mat-card,
tokens-mat-chip,
tokens-mat-datepicker,
tokens-mat-dialog,
tokens-mat-divider,
tokens-mat-expansion,
tokens-mat-fab,
tokens-mat-fab-small,
tokens-mat-filled-button,
tokens-mat-form-field,
tokens-mat-grid-list,
tokens-mat-icon-button,
tokens-mat-icon,
tokens-mat-menu,
tokens-mat-optgroup,
tokens-mat-option,
tokens-mat-outlined-button,
tokens-mat-paginator,
tokens-mat-checkbox,
tokens-mat-full-pseudo-checkbox,
tokens-mat-list,
tokens-mat-minimal-pseudo-checkbox,
tokens-mat-protected-button,
tokens-mat-radio,
tokens-mat-ripple,
tokens-mat-select,
tokens-mat-sidenav,
tokens-mat-slider,
tokens-mat-switch,
tokens-mat-snack-bar,
tokens-mat-sort,
tokens-mat-stepper,
tokens-mat-tab-header,
tokens-mat-table,
tokens-mat-text-button,
tokens-mat-toolbar,
tokens-mat-tree,
tokens-mat-timepicker,
// MDC tokens
tokens-mdc-checkbox,
tokens-mdc-chip,
tokens-mdc-text-button,
tokens-mdc-protected-button,
tokens-mdc-filled-button,
tokens-mdc-outlined-button,
tokens-mdc-chip,
tokens-mdc-circular-progress,
tokens-mdc-dialog,
tokens-mdc-elevated-card,
tokens-mdc-extended-fab,
tokens-mdc-fab,
tokens-mdc-fab-small,
tokens-mdc-filled-text-field,
tokens-mdc-icon-button,
tokens-mdc-linear-progress,
tokens-mdc-list,
tokens-mdc-outlined-card,
tokens-mdc-outlined-text-field,
tokens-mdc-plain-tooltip,
tokens-mdc-radio,
tokens-mdc-slider,
tokens-mdc-snack-bar,
tokens-mdc-switch,
tokens-mdc-secondary-navigation-tab,
tokens-mdc-tab-indicator
);
/// Gets the full set of M3 tokens for the given theme object.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} Full set of M3 tokens
@function get-m3-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: ();
@each $module-name in $_module-names {
$fn: meta.get-function(
$name: 'get-tokens',
$module: $module-name,
);
$tokens: map.merge($tokens, meta.call($fn, $systems, $exclude-hardcoded, $token-slots));
}
@return $tokens;
}
| {
"end_byte": 5727,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/_index.scss"
} |
components/src/material/core/tokens/m3/mdc/_checkbox.scss_0_5776 | @use 'sass:map';
@use 'sass:meta';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, checkbox);
/// Generates the tokens for MDC checkbox
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC checkbox
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$mdc-tokens: token-definition.get-mdc-tokens('checkbox', $systems, $exclude-hardcoded);
$variant-tokens: (
primary: (), // Default, no overrides needed
secondary: (
selected-container-color: map.get($systems, md-sys-color, secondary),
selected-focus-container-color: map.get($systems, md-sys-color, secondary),
selected-focus-icon-color: map.get($systems, md-sys-color, on-secondary),
selected-focus-state-layer-color: map.get($systems, md-sys-color, secondary),
selected-hover-container-color: map.get($systems, md-sys-color, secondary),
selected-hover-icon-color: map.get($systems, md-sys-color, on-secondary),
selected-hover-state-layer-color: map.get($systems, md-sys-color, secondary),
selected-icon-color: map.get($systems, md-sys-color, on-secondary),
selected-pressed-container-color: map.get($systems, md-sys-color, secondary),
selected-pressed-icon-color: map.get($systems, md-sys-color, on-secondary),
unselected-pressed-state-layer-color: map.get($systems, md-sys-color, secondary),
),
tertiary: (
selected-container-color: map.get($systems, md-sys-color, tertiary),
selected-focus-container-color: map.get($systems, md-sys-color, tertiary),
selected-focus-icon-color: map.get($systems, md-sys-color, on-tertiary),
selected-focus-state-layer-color: map.get($systems, md-sys-color, tertiary),
selected-hover-container-color: map.get($systems, md-sys-color, tertiary),
selected-hover-icon-color: map.get($systems, md-sys-color, on-tertiary),
selected-hover-state-layer-color: map.get($systems, md-sys-color, tertiary),
selected-icon-color: map.get($systems, md-sys-color, on-tertiary),
selected-pressed-container-color: map.get($systems, md-sys-color, tertiary),
selected-pressed-icon-color: map.get($systems, md-sys-color, on-tertiary),
unselected-pressed-state-layer-color: map.get($systems, md-sys-color, tertiary),
),
error: (
selected-container-color: map.get($systems, md-sys-color, error),
selected-focus-container-color: map.get($systems, md-sys-color, error),
selected-focus-icon-color: map.get($systems, md-sys-color, on-error),
selected-focus-state-layer-color: map.get($systems, md-sys-color, error),
selected-hover-container-color: map.get($systems, md-sys-color, error),
selected-hover-icon-color: map.get($systems, md-sys-color, on-error),
selected-hover-state-layer-color: map.get($systems, md-sys-color, error),
selected-icon-color: map.get($systems, md-sys-color, on-error),
selected-pressed-container-color: map.get($systems, md-sys-color, error),
selected-pressed-icon-color: map.get($systems, md-sys-color, on-error),
unselected-pressed-state-layer-color: map.get($systems, md-sys-color, error),
)
);
@return token-definition.namespace-tokens(
$prefix,
(
_fix-tokens($mdc-tokens),
token-definition.map-values($variant-tokens, meta.get-function(_fix-tokens))
),
$token-slots
);
}
/// Renames the official checkbox tokens to match the names actually used in MDC's code (which are
/// different). This is a temporary workaround until MDC updates to use the correct names for the
/// tokens.
/// @param {Map} $tokens The map of checkbox tokens with the official tokens names
/// @param {Map} $all-tokens Map of all checkbox tokens, including hardcoded values.
/// This is necessary in order to do opacity lookups.
/// @return {Map} The given tokens, renamed to be compatible with MDC's token implementation.
@function _fix-tokens($tokens) {
// Need to get the hardcoded values, because they include opacities that are used for the disabled
// state.
$hardcoded-tokens: token-definition.get-mdc-tokens('checkbox', (), false);
$rename-keys: (
selected-icon-color: selected-checkmark-color,
selected-disabled-icon-color: disabled-selected-checkmark-color,
selected-container-color: selected-icon-color,
selected-hover-container-color: selected-hover-icon-color,
selected-disabled-container-color: disabled-selected-icon-color,
selected-disabled-container-opacity: disabled-selected-icon-opacity,
selected-focus-container-color: selected-focus-icon-color,
selected-pressed-container-color: selected-pressed-icon-color,
unselected-disabled-outline-color: disabled-unselected-icon-color,
unselected-disabled-container-opacity: disabled-unselected-icon-opacity,
unselected-focus-outline-color: unselected-focus-icon-color,
unselected-hover-outline-color: unselected-hover-icon-color,
unselected-outline-color: unselected-icon-color,
unselected-pressed-outline-color: unselected-pressed-icon-color
);
$remapped-tokens: token-definition.rename-map-keys($tokens, $rename-keys);
$remapped-hardcoded-tokens:
token-definition.rename-map-keys($hardcoded-tokens, $rename-keys);
@return token-definition.combine-color-tokens(
$remapped-tokens, $remapped-hardcoded-tokens, (
(
color: disabled-selected-icon-color,
opacity: disabled-selected-icon-opacity,
),
(
color: disabled-unselected-icon-color,
opacity: disabled-unselected-icon-opacity,
),
));
}
| {
"end_byte": 5776,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_checkbox.scss"
} |
components/src/material/core/tokens/m3/mdc/_extended-fab.scss_0_1441 | @use 'sass:map';
@use '../../../style/elevation';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, extended-fab);
/// Generates the tokens for MDC extended-fab
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC extended-fab
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens:
token-definition.get-mdc-tokens('extended-fab-primary', $systems, $exclude-hardcoded);
$elevation-tokens: (
container-elevation,
focus-container-elevation,
hover-container-elevation,
pressed-container-elevation,
);
@each $token in $elevation-tokens {
$elevation: map.get($tokens, $token);
@if ($elevation != null) {
$tokens: map.set($tokens, $token + '-shadow', elevation.get-box-shadow($elevation));
}
}
$variant-tokens: (
// Color variants
primary: (), // Default, no overrides needed.
secondary: token-definition.get-mdc-tokens(
'extended-fab-secondary', $systems, $exclude-hardcoded),
tertiary: token-definition.get-mdc-tokens(
'extended-fab-tertiary', $systems, $exclude-hardcoded)
);
@return token-definition.namespace-tokens(
$prefix, ($tokens, $variant-tokens), $token-slots);
}
| {
"end_byte": 1441,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_extended-fab.scss"
} |
components/src/material/core/tokens/m3/mdc/_filled-text-field.scss_0_3386 | @use 'sass:map';
@use 'sass:meta';
@use 'sass:list';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, filled-text-field);
/// Generates the tokens for MDC filled-text-field
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC filled-text-field
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$mdc-tokens: token-definition.get-mdc-tokens(
'filled-text-field', $systems, $exclude-hardcoded);
$variant-tokens: (
primary: (), // Default, no overrides needed
secondary: (
caret-color: map.get($systems, md-sys-color, secondary),
focus-active-indicator-color: map.get($systems, md-sys-color, secondary),
focus-label-text-color: map.get($systems, md-sys-color, secondary),
),
tertiary: (
caret-color: map.get($systems, md-sys-color, tertiary),
focus-active-indicator-color: map.get($systems, md-sys-color, tertiary),
focus-label-text-color: map.get($systems, md-sys-color, tertiary),
),
error: (
caret-color: map.get($systems, md-sys-color, error),
focus-active-indicator-color: map.get($systems, md-sys-color, error),
focus-label-text-color: map.get($systems, md-sys-color, error),
),
);
@return token-definition.namespace-tokens($prefix, (
_fix-tokens($mdc-tokens),
token-definition.map-values($variant-tokens, meta.get-function(_fix-tokens))
), $token-slots);
}
/// Fixes inconsistent values in the filled text field tokens so that they can produce valid
/// styles.
/// @param {Map} $initial-tokens Map of filled text field tokens currently being generated.
/// @return {Map} The given tokens, with the invalid values replaced with valid ones.
@function _fix-tokens($initial-tokens) {
// Need to get the hardcoded values, because they include opacities that are used for the disabled
// state.
$hardcoded-tokens: token-definition.get-mdc-tokens('filled-text-field', (), false);
$tokens: token-definition.combine-color-tokens($initial-tokens, $hardcoded-tokens, (
(
color: disabled-active-indicator-color,
opacity: disabled-active-indicator-opacity
),
(
color: disabled-container-color,
opacity: disabled-container-opacity
),
(
color: disabled-input-text-color,
opacity: disabled-input-text-opacity
),
(
color: disabled-label-text-color,
opacity: disabled-label-text-opacity
),
(
color: disabled-leading-icon-color,
opacity: disabled-leading-icon-opacity
),
(
color: disabled-supporting-text-color,
opacity: disabled-supporting-text-opacity
),
(
color: disabled-trailing-icon-color,
opacity: disabled-trailing-icon-opacity
)
));
$container-shape: map.get($tokens, container-shape);
// The M2 token slots define a single `container-shape` slot while the M3 tokens provide a list
// of shapes (e.g. top/bottom/left/right). Extract the first value so it matches the expected
// token slot in M2.
@if meta.type-of($container-shape) == 'list' {
$tokens: map.set($tokens, container-shape, list.nth($container-shape, 1));
}
@return $tokens;
}
| {
"end_byte": 3386,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_filled-text-field.scss"
} |
components/src/material/core/tokens/m3/mdc/_tab-indicator.scss_0_1250 | @use 'sass:map';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, tab-indicator);
/// Generates the tokens for MDC tab-indicator
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC tab-indicator
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: (
active-indicator-height: token-definition.hardcode(2px, $exclude-hardcoded),
active-indicator-shape: token-definition.hardcode(0, $exclude-hardcoded),
active-indicator-color: map.get($systems, md-sys-color, primary),
);
$variant-tokens: (
// Color variants
primary: (), // Default, no overrides needed
secondary: (
active-indicator-color: map.get($systems, md-sys-color, secondary),
),
tertiary: (
active-indicator-color: map.get($systems, md-sys-color, tertiary),
),
error: (
active-indicator-color: map.get($systems, md-sys-color, error),
)
);
@return token-definition.namespace-tokens(
$prefix, ($tokens, $variant-tokens), $token-slots);
}
| {
"end_byte": 1250,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_tab-indicator.scss"
} |
components/src/material/core/tokens/m3/mdc/_outlined-card.scss_0_898 | @use 'sass:map';
@use '../../../style/elevation';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, outlined-card);
/// Generates the tokens for MDC outlined-card
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC outlined-card
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: token-definition.get-mdc-tokens('outlined-card', $systems, $exclude-hardcoded);
$elevation: map.get($tokens, container-elevation);
@if ($elevation != null) {
$tokens: map.set($tokens, container-elevation, elevation.get-box-shadow($elevation));
}
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 898,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_outlined-card.scss"
} |
components/src/material/core/tokens/m3/mdc/_protected-button.scss_0_4702 | @use 'sass:map';
@use 'sass:meta';
@use '../../../style/elevation';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, protected-button);
/// Generates the tokens for MDC protected-button
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC protected-button
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
// Note: in M3 the "protected" button is called "elevated".
$tokens: token-definition.get-mdc-tokens('elevated-button', $systems, $exclude-hardcoded);
$variant-tokens: (
primary: (), // Default, no overrides needed.
secondary: (
focus-label-text-color: map.get($systems, md-sys-color, secondary),
focus-state-layer-color: map.get($systems, md-sys-color, secondary),
hover-label-text-color: map.get($systems, md-sys-color, secondary),
hover-state-layer-color: map.get($systems, md-sys-color, secondary),
label-text-color: map.get($systems, md-sys-color, secondary),
pressed-label-text-color: map.get($systems, md-sys-color, secondary),
pressed-state-layer-color: map.get($systems, md-sys-color, secondary),
with-icon-focus-icon-color: map.get($systems, md-sys-color, secondary),
with-icon-hover-icon-color: map.get($systems, md-sys-color, secondary),
with-icon-icon-color: map.get($systems, md-sys-color, secondary),
with-icon-pressed-icon-color: map.get($systems, md-sys-color, secondary)
),
tertiary: (
focus-label-text-color: map.get($systems, md-sys-color, tertiary),
focus-state-layer-color: map.get($systems, md-sys-color, tertiary),
hover-label-text-color: map.get($systems, md-sys-color, tertiary),
hover-state-layer-color: map.get($systems, md-sys-color, tertiary),
label-text-color: map.get($systems, md-sys-color, tertiary),
pressed-label-text-color: map.get($systems, md-sys-color, tertiary),
pressed-state-layer-color: map.get($systems, md-sys-color, tertiary),
with-icon-focus-icon-color: map.get($systems, md-sys-color, tertiary),
with-icon-hover-icon-color: map.get($systems, md-sys-color, tertiary),
with-icon-icon-color: map.get($systems, md-sys-color, tertiary),
with-icon-pressed-icon-color: map.get($systems, md-sys-color, tertiary)
),
error: (
focus-label-text-color: map.get($systems, md-sys-color, error),
focus-state-layer-color: map.get($systems, md-sys-color, error),
hover-label-text-color: map.get($systems, md-sys-color, error),
hover-state-layer-color: map.get($systems, md-sys-color, error),
label-text-color: map.get($systems, md-sys-color, error),
pressed-label-text-color: map.get($systems, md-sys-color, error),
pressed-state-layer-color: map.get($systems, md-sys-color, error),
with-icon-focus-icon-color: map.get($systems, md-sys-color, error),
with-icon-hover-icon-color: map.get($systems, md-sys-color, error),
with-icon-icon-color: map.get($systems, md-sys-color, error),
with-icon-pressed-icon-color: map.get($systems, md-sys-color, error)
)
);
@return token-definition.namespace-tokens($prefix, (
_fix-tokens($tokens),
token-definition.map-values($variant-tokens, meta.get-function(_fix-tokens)),
), $token-slots);
}
/// Fixes inconsistent values in the protected button tokens so that they can produce valid styles.
/// @param {Map} $initial-tokens Map of protected button tokens currently being generated.
/// @return {Map} The given tokens, with the invalid values replaced with valid ones.
@function _fix-tokens($initial-tokens) {
// Need to get the hardcoded values, because they include
// opacities that are used for the disabled state.
$hardcoded-tokens: token-definition.get-mdc-tokens('elevated-button', (), false);
$tokens: $initial-tokens;
$elevation-tokens: (
container-elevation,
disabled-container-elevation,
focus-container-elevation,
hover-container-elevation,
pressed-container-elevation,
);
@each $token in $elevation-tokens {
$elevation: map.get($tokens, $token);
@if ($elevation != null) {
$tokens: map.set($tokens, $token + '-shadow', elevation.get-box-shadow($elevation));
}
}
@return token-definition.combine-color-tokens($tokens, $hardcoded-tokens, (
(
color: disabled-label-text-color,
opacity: disabled-label-text-opacity,
),
(
color: disabled-container-color,
opacity: disabled-container-opacity,
)
));
}
| {
"end_byte": 4702,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_protected-button.scss"
} |
components/src/material/core/tokens/m3/mdc/_radio.scss_0_2484 | @use 'sass:map';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, radio);
/// Generates the tokens for MDC radio
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC radio
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$mdc-tokens: token-definition.get-mdc-tokens('radio-button', $systems, $exclude-hardcoded);
$variant-tokens: (
primary: (), // Default, no overrides needed
secondary: (
selected-focus-icon-color: map.get($systems, md-sys-color, secondary),
selected-focus-state-layer-color: map.get($systems, md-sys-color, secondary),
selected-hover-icon-color: map.get($systems, md-sys-color, secondary),
selected-hover-state-layer-color: map.get($systems, md-sys-color, secondary),
selected-icon-color: map.get($systems, md-sys-color, secondary),
selected-pressed-icon-color: map.get($systems, md-sys-color, secondary),
unselected-pressed-state-layer-color: map.get($systems, md-sys-color, secondary),
),
tertiary: (
selected-focus-icon-color: map.get($systems, md-sys-color, tertiary),
selected-focus-state-layer-color: map.get($systems, md-sys-color, tertiary),
selected-hover-icon-color: map.get($systems, md-sys-color, tertiary),
selected-hover-state-layer-color: map.get($systems, md-sys-color, tertiary),
selected-icon-color: map.get($systems, md-sys-color, tertiary),
selected-pressed-icon-color: map.get($systems, md-sys-color, tertiary),
unselected-pressed-state-layer-color: map.get($systems, md-sys-color, tertiary),
),
error: (
selected-focus-icon-color: map.get($systems, md-sys-color, error),
selected-focus-state-layer-color: map.get($systems, md-sys-color, error),
selected-hover-icon-color: map.get($systems, md-sys-color, error),
selected-hover-state-layer-color: map.get($systems, md-sys-color, error),
selected-icon-color: map.get($systems, md-sys-color, error),
selected-pressed-icon-color: map.get($systems, md-sys-color, error),
unselected-pressed-state-layer-color: map.get($systems, md-sys-color, error),
),
);
@return token-definition.namespace-tokens(
$prefix, ($mdc-tokens, $variant-tokens), $token-slots);
}
| {
"end_byte": 2484,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_radio.scss"
} |
components/src/material/core/tokens/m3/mdc/_chip.scss_0_5611 | @use 'sass:map';
@use '../../../style/sass-utils';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, chip);
/// Generates the tokens for MDC chip
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC chip
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
// MDC has a chip component, but they seem to have made up the tokens rather than using ones
// generated from the token database, therefore we need a custom token function for it.
$tokens: sass-utils.merge-all(
token-definition.generate-typography-tokens($systems, label-text, label-large),
(
container-shape-radius: token-definition.hardcode(8px, $exclude-hardcoded),
with-avatar-avatar-size: token-definition.hardcode(24px, $exclude-hardcoded),
with-avatar-avatar-shape-radius: token-definition.hardcode(24px, $exclude-hardcoded),
label-text-color: map.get($systems, md-sys-color, on-surface-variant),
disabled-label-text-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-surface),
$alpha: 0.38,
),
with-icon-icon-size: token-definition.hardcode(18px, $exclude-hardcoded),
with-icon-icon-color: map.get($systems, md-sys-color, on-surface-variant),
with-icon-disabled-icon-color: map.get($systems, md-sys-color, on-surface),
with-icon-selected-icon-color: map.get($systems, md-sys-color, on-secondary-container),
with-trailing-icon-trailing-icon-color: map.get($systems, md-sys-color, on-surface-variant),
with-trailing-icon-disabled-trailing-icon-color: map.get($systems, md-sys-color, on-surface),
focus-state-layer-opacity: map.get($systems, md-sys-state, focus-state-layer-opacity),
focus-state-layer-color: map.get($systems, md-sys-color, on-surface-variant),
outline-width: token-definition.hardcode(1px, $exclude-hardcoded),
outline-color: map.get($systems, md-sys-color, outline),
disabled-outline-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-surface),
$alpha: 0.12,
),
focus-outline-color: map.get($systems, md-sys-color, on-surface-variant),
hover-state-layer-color: map.get($systems, md-sys-color, on-surface-variant),
hover-state-layer-opacity: map.get($systems, md-sys-state, hover-state-layer-opacity),
with-avatar-disabled-avatar-opacity:
token-definition.hardcode(0.38, $exclude-hardcoded),
elevated-selected-container-color: map.get($systems, md-sys-color, secondary-container),
// In the M3 tokens this is a `surface` color, but in the MDC implementation it's
// never being emitted. We emit `transparent` so consumers override the color.
elevated-container-color: token-definition.hardcode(transparent, $exclude-hardcoded),
flat-selected-outline-width: token-definition.hardcode(0, $exclude-hardcoded),
selected-label-text-color: map.get($systems, md-sys-color, on-secondary-container),
flat-disabled-selected-container-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-surface),
$alpha: 0.12,
),
selected-hover-state-layer-color: map.get($systems, md-sys-color, on-secondary-container),
selected-hover-state-layer-opacity:
map.get($systems, md-sys-state, hover-state-layer-opacity),
selected-focus-state-layer-color: map.get($systems, md-sys-color, on-secondary-container),
selected-focus-state-layer-opacity:
map.get($systems, md-sys-state, focus-state-layer-opacity),
with-icon-disabled-icon-opacity: token-definition.hardcode(0.38, $exclude-hardcoded),
with-trailing-icon-disabled-trailing-icon-opacity:
token-definition.hardcode(0.38, $exclude-hardcoded),
),
), (
// Color variants:
primary: (
with-icon-selected-icon-color: map.get($systems, md-sys-color, on-primary-container),
elevated-selected-container-color: map.get($systems, md-sys-color, primary-container),
selected-label-text-color: map.get($systems, md-sys-color, on-primary-container),
selected-hover-state-layer-color: map.get($systems, md-sys-color, on-primary-container),
selected-focus-state-layer-color: map.get($systems, md-sys-color, on-primary-container),
),
secondary: (), // Default, no overrides needed.
tertiary: (
with-icon-selected-icon-color: map.get($systems, md-sys-color, on-tertiary-container),
elevated-selected-container-color: map.get($systems, md-sys-color, tertiary-container),
selected-label-text-color: map.get($systems, md-sys-color, on-tertiary-container),
selected-hover-state-layer-color: map.get($systems, md-sys-color, on-tertiary-container),
selected-focus-state-layer-color: map.get($systems, md-sys-color, on-tertiary-container),
),
error: (
with-icon-selected-icon-color: map.get($systems, md-sys-color, on-error-container),
elevated-selected-container-color: map.get($systems, md-sys-color, error-container),
selected-label-text-color: map.get($systems, md-sys-color, on-error-container),
selected-hover-state-layer-color: map.get($systems, md-sys-color, on-error-container),
selected-focus-state-layer-color: map.get($systems, md-sys-color, on-error-container),
)
);
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 5611,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_chip.scss"
} |
components/src/material/core/tokens/m3/mdc/_text-button.scss_0_4071 | @use 'sass:map';
@use 'sass:meta';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, text-button);
/// Generates the tokens for MDC text-button
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC text-button
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$mdc-tokens: token-definition.get-mdc-tokens('text-button', $systems, $exclude-hardcoded);
$variant-tokens: (
primary: (), // Default, no overrides needed.
secondary: (
focus-label-text-color: map.get($systems, md-sys-color, secondary),
focus-state-layer-color: map.get($systems, md-sys-color, secondary),
hover-label-text-color: map.get($systems, md-sys-color, secondary),
hover-state-layer-color: map.get($systems, md-sys-color, secondary),
label-text-color: map.get($systems, md-sys-color, secondary),
pressed-label-text-color: map.get($systems, md-sys-color, secondary),
pressed-state-layer-color: map.get($systems, md-sys-color, secondary),
with-icon-focus-icon-color: map.get($systems, md-sys-color, secondary),
with-icon-hover-icon-color: map.get($systems, md-sys-color, secondary),
with-icon-icon-color: map.get($systems, md-sys-color, secondary),
with-icon-pressed-icon-color: map.get($systems, md-sys-color, secondary)
),
tertiary: (
focus-label-text-color: map.get($systems, md-sys-color, tertiary),
focus-state-layer-color: map.get($systems, md-sys-color, tertiary),
hover-label-text-color: map.get($systems, md-sys-color, tertiary),
hover-state-layer-color: map.get($systems, md-sys-color, tertiary),
label-text-color: map.get($systems, md-sys-color, tertiary),
pressed-label-text-color: map.get($systems, md-sys-color, tertiary),
pressed-state-layer-color: map.get($systems, md-sys-color, tertiary),
with-icon-focus-icon-color: map.get($systems, md-sys-color, tertiary),
with-icon-hover-icon-color: map.get($systems, md-sys-color, tertiary),
with-icon-icon-color: map.get($systems, md-sys-color, tertiary),
with-icon-pressed-icon-color: map.get($systems, md-sys-color, tertiary)
),
error: (
focus-label-text-color: map.get($systems, md-sys-color, error),
focus-state-layer-color: map.get($systems, md-sys-color, error),
hover-label-text-color: map.get($systems, md-sys-color, error),
hover-state-layer-color: map.get($systems, md-sys-color, error),
label-text-color: map.get($systems, md-sys-color, error),
pressed-label-text-color: map.get($systems, md-sys-color, error),
pressed-state-layer-color: map.get($systems, md-sys-color, error),
with-icon-focus-icon-color: map.get($systems, md-sys-color, error),
with-icon-hover-icon-color: map.get($systems, md-sys-color, error),
with-icon-icon-color: map.get($systems, md-sys-color, error),
with-icon-pressed-icon-color: map.get($systems, md-sys-color, error)
)
);
@return token-definition.namespace-tokens($prefix, (
_fix-tokens($mdc-tokens),
token-definition.map-values($variant-tokens, meta.get-function(_fix-tokens))
), $token-slots);
}
/// Fixes inconsistent values in the text button tokens so that they can produce valid styles.
/// @param {Map} $initial-tokens Map of text button tokens currently being generated.
/// @return {Map} The given tokens, with the invalid values replaced with valid ones.
@function _fix-tokens($initial-tokens) {
// Need to get the hardcoded values, because they include opacities that are used for the disabled
// state.
$hardcoded-tokens: token-definition.get-mdc-tokens('text-button', (), false);
@return token-definition.combine-color-tokens($initial-tokens, $hardcoded-tokens, (
(
color: disabled-label-text-color,
opacity: disabled-label-text-opacity,
),
));
}
| {
"end_byte": 4071,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_text-button.scss"
} |
components/src/material/core/tokens/m3/mdc/_outlined-button.scss_0_4290 | @use 'sass:map';
@use 'sass:meta';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, outlined-button);
/// Generates the tokens for MDC outlined-button
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC outlined-button
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$mdc-tokens: token-definition.get-mdc-tokens(
'outlined-button', $systems, $exclude-hardcoded);
$variant-tokens: (
primary: (), // Default, no overrides needed.
secondary: (
focus-label-text-color: map.get($systems, md-sys-color, secondary),
focus-outline-color: map.get($systems, md-sys-color, secondary),
focus-state-layer-color: map.get($systems, md-sys-color, secondary),
hover-label-text-color: map.get($systems, md-sys-color, secondary),
hover-state-layer-color: map.get($systems, md-sys-color, secondary),
label-text-color: map.get($systems, md-sys-color, secondary),
pressed-label-text-color: map.get($systems, md-sys-color, secondary),
pressed-state-layer-color: map.get($systems, md-sys-color, secondary),
with-icon-focus-icon-color: map.get($systems, md-sys-color, secondary),
with-icon-hover-icon-color: map.get($systems, md-sys-color, secondary),
with-icon-icon-color: map.get($systems, md-sys-color, secondary),
with-icon-pressed-icon-color: map.get($systems, md-sys-color, secondary)
),
tertiary: (
focus-label-text-color: map.get($systems, md-sys-color, tertiary),
focus-outline-color: map.get($systems, md-sys-color, tertiary),
focus-state-layer-color: map.get($systems, md-sys-color, tertiary),
hover-label-text-color: map.get($systems, md-sys-color, tertiary),
hover-state-layer-color: map.get($systems, md-sys-color, tertiary),
label-text-color: map.get($systems, md-sys-color, tertiary),
pressed-label-text-color: map.get($systems, md-sys-color, tertiary),
pressed-state-layer-color: map.get($systems, md-sys-color, tertiary),
with-icon-focus-icon-color: map.get($systems, md-sys-color, tertiary),
with-icon-hover-icon-color: map.get($systems, md-sys-color, tertiary),
with-icon-icon-color: map.get($systems, md-sys-color, tertiary),
with-icon-pressed-icon-color: map.get($systems, md-sys-color, tertiary)
),
error: (
focus-label-text-color: map.get($systems, md-sys-color, error),
focus-outline-color: map.get($systems, md-sys-color, error),
focus-state-layer-color: map.get($systems, md-sys-color, error),
hover-label-text-color: map.get($systems, md-sys-color, error),
hover-state-layer-color: map.get($systems, md-sys-color, error),
label-text-color: map.get($systems, md-sys-color, error),
pressed-label-text-color: map.get($systems, md-sys-color, error),
pressed-state-layer-color: map.get($systems, md-sys-color, error),
with-icon-focus-icon-color: map.get($systems, md-sys-color, error),
with-icon-hover-icon-color: map.get($systems, md-sys-color, error),
with-icon-icon-color: map.get($systems, md-sys-color, error),
with-icon-pressed-icon-color: map.get($systems, md-sys-color, error)
)
);
@return token-definition.namespace-tokens($prefix, (
_fix-tokens($mdc-tokens),
token-definition.map-values($variant-tokens, meta.get-function(_fix-tokens))
), $token-slots);
}
/// Fixes inconsistent values in the outlined button tokens so that they can produce valid styles.
/// @param {Map} $initial-tokens Map of outlined button tokens currently being generated.
/// @return {Map} The given tokens, with the invalid values replaced with valid ones.
@function _fix-tokens($initial-tokens) {
$hardcoded-tokens: token-definition.get-mdc-tokens('outlined-button', (), false);
@return token-definition.combine-color-tokens($initial-tokens, $hardcoded-tokens, (
(
color: disabled-label-text-color,
opacity: disabled-label-text-opacity,
),
(
color: disabled-outline-color,
opacity: disabled-outline-opacity,
)
));
}
| {
"end_byte": 4290,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_outlined-button.scss"
} |
components/src/material/core/tokens/m3/mdc/_elevated-card.scss_0_898 | @use 'sass:map';
@use '../../../style/elevation';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, elevated-card);
/// Generates the tokens for MDC elevated-card
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC elevated-card
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: token-definition.get-mdc-tokens('elevated-card', $systems, $exclude-hardcoded);
$elevation: map.get($tokens, container-elevation);
@if ($elevation != null) {
$tokens: map.set($tokens, container-elevation, elevation.get-box-shadow($elevation));
}
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 898,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_elevated-card.scss"
} |
components/src/material/core/tokens/m3/mdc/_dialog.scss_0_930 | @use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, dialog);
/// Generates the tokens for MDC dialog
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC dialog
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: token-definition.get-mdc-tokens('dialog', $systems, $exclude-hardcoded);
$tokens: token-definition.rename-map-keys($tokens, (
headline-color: subhead-color,
headline-font: subhead-font,
headline-line-height: subhead-line-height,
headline-size: subhead-size,
headline-tracking: subhead-tracking,
headline-weight: subhead-weight,
));
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 930,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_dialog.scss"
} |
components/src/material/core/tokens/m3/mdc/_linear-progress.scss_0_1320 | @use 'sass:map';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, linear-progress);
/// Generates the tokens for MDC linear-progress
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC linear-progress
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$mdc-tokens: token-definition.get-mdc-tokens(
'linear-progress-indicator', $systems, $exclude-hardcoded);
$variant-tokens: (
primary: (), // Default, no overrides needed
secondary: (
active-indicator-color: map.get($systems, md-sys-color, secondary),
track-color: map.get($systems, md-sys-color, secondary-container),
),
tertiary: (
active-indicator-color: map.get($systems, md-sys-color, tertiary),
track-color: map.get($systems, md-sys-color, tertiary-container),
),
error: (
active-indicator-color: map.get($systems, md-sys-color, error),
track-color: map.get($systems, md-sys-color, error-container),
),
);
@return token-definition.namespace-tokens(
$prefix, ($mdc-tokens, $variant-tokens), $token-slots);
}
| {
"end_byte": 1320,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_linear-progress.scss"
} |
components/src/material/core/tokens/m3/mdc/_outlined-text-field.scss_0_3167 | @use 'sass:map';
@use 'sass:meta';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, outlined-text-field);
/// Generates the tokens for MDC outlined-text-field
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC outlined-text-field
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$mdc-tokens: token-definition.get-mdc-tokens(
'outlined-text-field', $systems, $exclude-hardcoded);
$variant-tokens: (
primary: (), // Default, no overrides needed
secondary: (
caret-color: map.get($systems, md-sys-color, secondary),
focus-label-text-color: map.get($systems, md-sys-color, secondary),
focus-outline-color: map.get($systems, md-sys-color, secondary),
),
tertiary: (
caret-color: map.get($systems, md-sys-color, tertiary),
focus-label-text-color: map.get($systems, md-sys-color, tertiary),
focus-outline-color: map.get($systems, md-sys-color, tertiary),
),
error: (
caret-color: map.get($systems, md-sys-color, error),
focus-label-text-color: map.get($systems, md-sys-color, error),
focus-outline-color: map.get($systems, md-sys-color, error),
),
);
@return token-definition.namespace-tokens($prefix, (
_fix-tokens($mdc-tokens),
token-definition.map-values($variant-tokens, meta.get-function(_fix-tokens))
), $token-slots);
}
/// Fixes inconsistent values in the outlined text field tokens so that they can produce valid
/// styles.
/// @param {Map} $initial-tokens Map of outlined text field tokens currently being generated.
/// @param {Map} $all-tokens Map of all outlined text field tokens, including hardcoded values.
/// This is necessary in order to do opacity lookups.
/// @return {Map} The given tokens, with the invalid values replaced with valid ones.
@function _fix-tokens($initial-tokens) {
// Need to get the hardcoded values, because they include opacities that are used for the disabled
// state.
$hardcoded-tokens: token-definition.get-mdc-tokens('outlined-text-field', (), false);
@return token-definition.combine-color-tokens($initial-tokens, $hardcoded-tokens, (
(
color: disabled-outline-color,
opacity: disabled-outline-opacity
),
(
color: disabled-active-indicator-color,
opacity: disabled-active-indicator-opacity
),
(
color: disabled-container-color,
opacity: disabled-container-opacity
),
(
color: disabled-input-text-color,
opacity: disabled-input-text-opacity
),
(
color: disabled-label-text-color,
opacity: disabled-label-text-opacity
),
(
color: disabled-leading-icon-color,
opacity: disabled-leading-icon-opacity
),
(
color: disabled-supporting-text-color,
opacity: disabled-supporting-text-opacity
),
(
color: disabled-trailing-icon-color,
opacity: disabled-trailing-icon-opacity
)
));
}
| {
"end_byte": 3167,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_outlined-text-field.scss"
} |
components/src/material/core/tokens/m3/mdc/_filled-button.scss_0_4474 | @use 'sass:map';
@use 'sass:meta';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, filled-button);
/// Generates the tokens for MDC filled-button
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC filled-button
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$mdc-tokens: token-definition.get-mdc-tokens('filled-button', $systems, $exclude-hardcoded);
$variant-tokens: (
primary: (), // Default, no overrides needed.
secondary: (
container-color: map.get($systems, md-sys-color, secondary),
focus-label-text-color: map.get($systems, md-sys-color, on-secondary),
focus-state-layer-color: map.get($systems, md-sys-color, on-secondary),
hover-label-text-color: map.get($systems, md-sys-color, on-secondary),
hover-state-layer-color: map.get($systems, md-sys-color, on-secondary),
label-text-color: map.get($systems, md-sys-color, on-secondary),
pressed-label-text-color: map.get($systems, md-sys-color, on-secondary),
pressed-state-layer-color: map.get($systems, md-sys-color, on-secondary),
with-icon-focus-icon-color: map.get($systems, md-sys-color, on-secondary),
with-icon-hover-icon-color: map.get($systems, md-sys-color, on-secondary),
with-icon-icon-color: map.get($systems, md-sys-color, on-secondary),
with-icon-pressed-icon-color: map.get($systems, md-sys-color, on-secondary)
),
tertiary: (
container-color: map.get($systems, md-sys-color, tertiary),
focus-label-text-color: map.get($systems, md-sys-color, on-tertiary),
focus-state-layer-color: map.get($systems, md-sys-color, on-tertiary),
hover-label-text-color: map.get($systems, md-sys-color, on-tertiary),
hover-state-layer-color: map.get($systems, md-sys-color, on-tertiary),
label-text-color: map.get($systems, md-sys-color, on-tertiary),
pressed-label-text-color: map.get($systems, md-sys-color, on-tertiary),
pressed-state-layer-color: map.get($systems, md-sys-color, on-tertiary),
with-icon-focus-icon-color: map.get($systems, md-sys-color, on-tertiary),
with-icon-hover-icon-color: map.get($systems, md-sys-color, on-tertiary),
with-icon-icon-color: map.get($systems, md-sys-color, on-tertiary),
with-icon-pressed-icon-color: map.get($systems, md-sys-color, on-tertiary)
),
error: (
container-color: map.get($systems, md-sys-color, error),
focus-label-text-color: map.get($systems, md-sys-color, on-error),
focus-state-layer-color: map.get($systems, md-sys-color, on-error),
hover-label-text-color: map.get($systems, md-sys-color, on-error),
hover-state-layer-color: map.get($systems, md-sys-color, on-error),
label-text-color: map.get($systems, md-sys-color, on-error),
pressed-label-text-color: map.get($systems, md-sys-color, on-error),
pressed-state-layer-color: map.get($systems, md-sys-color, on-error),
with-icon-focus-icon-color: map.get($systems, md-sys-color, on-error),
with-icon-hover-icon-color: map.get($systems, md-sys-color, on-error),
with-icon-icon-color: map.get($systems, md-sys-color, on-error),
with-icon-pressed-icon-color: map.get($systems, md-sys-color, on-error)
)
);
@return token-definition.namespace-tokens($prefix, (
_fix-tokens($mdc-tokens),
token-definition.map-values($variant-tokens, meta.get-function(_fix-tokens))
), $token-slots);
}
/// Fixes inconsistent values in the filled button tokens so that they can produce valid styles.
/// @param {Map} $initial-tokens Map of filled button tokens currently being generated.
/// @return {Map} The given tokens, with the invalid values replaced with valid ones.
@function _fix-tokens($initial-tokens) {
// Need to get the hardcoded values, because they include opacities that are used for the disabled
// state.
$hardcoded-tokens: token-definition.get-mdc-tokens('filled-button', (), false);
@return token-definition.combine-color-tokens($initial-tokens, $hardcoded-tokens, (
(
color: disabled-label-text-color,
opacity: disabled-label-text-opacity,
),
(
color: disabled-container-color,
opacity: disabled-container-opacity,
)
));
}
| {
"end_byte": 4474,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_filled-button.scss"
} |
components/src/material/core/tokens/m3/mdc/_list.scss_0_1695 | @use 'sass:map';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, list);
/// Generates the tokens for MDC list
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC list
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$mdc-tokens: token-definition.get-mdc-tokens('list', $systems, $exclude-hardcoded);
@return token-definition.namespace-tokens($prefix, _fix-tokens($mdc-tokens), $token-slots);
}
/// Fixes values in the list tokens that are inconsistent with its usage.
/// @param {Map} $initial-tokens Map of list tokens currently being generated.
/// @return {Map} The given tokens, with the inconsistent values replaced with valid ones.
@function _fix-tokens($tokens) {
// This does not match the spec, which defines this to be `md.sys.color.surface`.
// However, this interferes with the use case of placing a list on other components. For example,
// the bottom sheet's container color is `md.sys.color.surface-container-low`. Instead, allow the
// list to just display the colors for its background.
@if map.get($tokens, list-item-container-color) != null {
$tokens: map.set($tokens, list-item-container-color, transparent);
}
// Match spec, which has list-item-leading-icon-size of 24px.
// Current version of tokens (0_161) has 18px.
@if map.get($tokens, list-item-leading-icon-size) != null {
$tokens: map.set($tokens, list-item-leading-icon-size, 24px);
}
@return $tokens;
}
| {
"end_byte": 1695,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_list.scss"
} |
components/src/material/core/tokens/m3/mdc/_snack-bar.scss_0_659 | @use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, snackbar);
/// Generates the tokens for MDC snackbar
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC snackbar
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$mdc-tokens: token-definition.get-mdc-tokens('snackbar', $systems, $exclude-hardcoded);
@return token-definition.namespace-tokens($prefix, $mdc-tokens, $token-slots);
}
| {
"end_byte": 659,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_snack-bar.scss"
} |
components/src/material/core/tokens/m3/mdc/_secondary-navigation-tab.scss_0_688 | @use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, secondary-navigation-tab);
/// Generates the tokens for MDC tab
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC tab
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$mdc-tokens: token-definition.get-mdc-tokens(
'secondary-navigation-tab', $systems, $exclude-hardcoded);
@return token-definition.namespace-tokens($prefix, $mdc-tokens, $token-slots);
}
| {
"end_byte": 688,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_secondary-navigation-tab.scss"
} |
components/src/material/core/tokens/m3/mdc/_slider.scss_0_3710 | @use 'sass:map';
@use '../../../style/elevation';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, slider);
/// Generates the tokens for MDC slider
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC slider
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: token-definition.get-mdc-tokens('slider', $systems, $exclude-hardcoded);
$handle-elevation: map.get($tokens, 'handle-elevation');
@if ($handle-elevation != null) {
$tokens: map.set($tokens, 'handle-elevation', elevation.get-box-shadow($handle-elevation));
}
$variant-tokens: (
primary: (), // Default, no overrides needed
secondary: (
active-track-color: map.get($systems, md-sys-color, secondary),
focus-handle-color: map.get($systems, md-sys-color, secondary),
focus-state-layer-color: map.get($systems, md-sys-color, secondary),
handle-color: map.get($systems, md-sys-color, secondary),
hover-handle-color: map.get($systems, md-sys-color, secondary),
hover-state-layer-color: map.get($systems, md-sys-color, secondary),
label-container-color: map.get($systems, md-sys-color, secondary),
label-label-text-color: map.get($systems, md-sys-color, on-secondary),
pressed-handle-color: map.get($systems, md-sys-color, secondary),
pressed-state-layer-color: map.get($systems, md-sys-color, secondary),
with-overlap-handle-outline-color: map.get($systems, md-sys-color, on-secondary),
with-tick-marks-active-container-color: map.get($systems, md-sys-color, on-secondary),
),
tertiary: (
active-track-color: map.get($systems, md-sys-color, tertiary),
focus-handle-color: map.get($systems, md-sys-color, tertiary),
focus-state-layer-color: map.get($systems, md-sys-color, tertiary),
handle-color: map.get($systems, md-sys-color, tertiary),
hover-handle-color: map.get($systems, md-sys-color, tertiary),
hover-state-layer-color: map.get($systems, md-sys-color, tertiary),
label-container-color: map.get($systems, md-sys-color, tertiary),
label-label-text-color: map.get($systems, md-sys-color, on-tertiary),
pressed-handle-color: map.get($systems, md-sys-color, tertiary),
pressed-state-layer-color: map.get($systems, md-sys-color, tertiary),
with-overlap-handle-outline-color: map.get($systems, md-sys-color, on-tertiary),
with-tick-marks-active-container-color: map.get($systems, md-sys-color, on-tertiary),
),
error: (
active-track-color: map.get($systems, md-sys-color, error),
focus-handle-color: map.get($systems, md-sys-color, error),
focus-state-layer-color: map.get($systems, md-sys-color, error),
handle-color: map.get($systems, md-sys-color, error),
hover-handle-color: map.get($systems, md-sys-color, error),
hover-state-layer-color: map.get($systems, md-sys-color, error),
label-container-color: map.get($systems, md-sys-color, error),
label-label-text-color: map.get($systems, md-sys-color, on-error),
pressed-handle-color: map.get($systems, md-sys-color, error),
pressed-state-layer-color: map.get($systems, md-sys-color, error),
with-overlap-handle-outline-color: map.get($systems, md-sys-color, on-error),
with-tick-marks-active-container-color: map.get($systems, md-sys-color, on-error),
),
);
@return token-definition.namespace-tokens(
$prefix, ($tokens, $variant-tokens), $token-slots);
}
| {
"end_byte": 3710,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_slider.scss"
} |
components/src/material/core/tokens/m3/mdc/_fab-small.scss_0_1417 | @use 'sass:map';
@use '../../../style/elevation';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, fab-small);
/// Generates the tokens for MDC fab-small
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC fab-small
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: token-definition.get-mdc-tokens('fab-primary-small', $systems, $exclude-hardcoded);
$elevation-tokens: (
container-elevation,
focus-container-elevation,
hover-container-elevation,
pressed-container-elevation,
);
@each $token in $elevation-tokens {
$elevation: map.get($tokens, $token);
@if ($elevation != null) {
$tokens: map.set($tokens, $token + '-shadow', elevation.get-box-shadow($elevation));
}
}
$variant-tokens: (
// Color variants
primary: (), // Default, no overrides needed.
secondary: token-definition.get-mdc-tokens(
'fab-secondary-small', $systems, $exclude-hardcoded),
tertiary: token-definition.get-mdc-tokens(
'fab-tertiary-small', $systems, $exclude-hardcoded)
);
@return token-definition.namespace-tokens(
$prefix, ($tokens, $variant-tokens), $token-slots);
}
| {
"end_byte": 1417,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_fab-small.scss"
} |
components/src/material/core/tokens/m3/mdc/_circular-progress.scss_0_1113 | @use 'sass:map';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, circular-progress);
/// Generates the tokens for MDC circular-progress
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC circular-progress
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$mdc-tokens: token-definition.get-mdc-tokens(
'circular-progress-indicator', $systems, $exclude-hardcoded);
$variant-tokens: (
primary: (), // Default, no overrides needed
secondary: (
active-indicator-color: map.get($systems, md-sys-color, secondary),
),
tertiary: (
active-indicator-color: map.get($systems, md-sys-color, tertiary),
),
error: (
active-indicator-color: map.get($systems, md-sys-color, error),
)
);
@return token-definition.namespace-tokens(
$prefix, ($mdc-tokens, $variant-tokens), $token-slots);
}
| {
"end_byte": 1113,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_circular-progress.scss"
} |
components/src/material/core/tokens/m3/mdc/_icon-button.scss_0_2177 | @use 'sass:map';
@use 'sass:meta';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, icon-button);
/// Generates the tokens for MDC icon-button
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC icon-button
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: token-definition.get-mdc-tokens('icon-button', $systems, $exclude-hardcoded);
$variant-tokens: (
primary: (
icon-color: map.get($systems, md-sys-color, primary)
),
secondary: (
icon-color: map.get($systems, md-sys-color, secondary)
),
tertiary: (
icon-color: map.get($systems, md-sys-color, tertiary)
),
error: (
icon-color: map.get($systems, md-sys-color, error)
)
);
@return token-definition.namespace-tokens($prefix, (
_fix-tokens($tokens),
token-definition.map-values($variant-tokens, meta.get-function(_fix-tokens))
), $token-slots);
}
/// Fixes inconsistent values in the icon button tokens so that they can produce valid styles.
/// @param {Map} $initial-tokens Map of icon button tokens currently being generated.
/// @param {Map} $all-tokens Map of all icon button tokens, including hardcoded values.
/// @return {Map} The given tokens, with the invalid values replaced with valid ones.
@function _fix-tokens($tokens) {
// Need to get the hardcoded values, because they include opacities that are used for the disabled
// state.
$hardcoded-tokens: token-definition.get-mdc-tokens('icon-button', (), false);
$rename-keys: (
unselected-icon-color: icon-color,
);
$remapped-tokens: token-definition.rename-map-keys($tokens, $rename-keys);
$remapped-hardcoded-tokens:
token-definition.rename-map-keys($hardcoded-tokens, $rename-keys);
@return token-definition.combine-color-tokens(
$remapped-tokens, $remapped-hardcoded-tokens, (
(
color: disabled-icon-color,
opacity: disabled-icon-opacity,
),
));
}
| {
"end_byte": 2177,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_icon-button.scss"
} |
components/src/material/core/tokens/m3/mdc/_plain-tooltip.scss_0_679 | @use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, plain-tooltip);
/// Generates the tokens for MDC plain-tooltip
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC plain-tooltip
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$mdc-tokens: token-definition.get-mdc-tokens('plain-tooltip', $systems, $exclude-hardcoded);
@return token-definition.namespace-tokens($prefix, $mdc-tokens, $token-slots);
}
| {
"end_byte": 679,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_plain-tooltip.scss"
} |
components/src/material/core/tokens/m3/mdc/_fab.scss_0_1363 | @use 'sass:map';
@use '../../../style/elevation';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, fab);
/// Generates the tokens for MDC fab
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC fab
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: token-definition.get-mdc-tokens('fab-primary', $systems, $exclude-hardcoded);
$elevation-tokens: (
container-elevation,
focus-container-elevation,
hover-container-elevation,
pressed-container-elevation,
);
@each $token in $elevation-tokens {
$elevation: map.get($tokens, $token);
@if ($elevation != null) {
$tokens: map.set($tokens, $token + '-shadow', elevation.get-box-shadow($elevation));
}
}
$variant-tokens: (
// Color variants
primary: (), // Default, no overrides needed.
secondary: token-definition.get-mdc-tokens('fab-secondary', $systems, $exclude-hardcoded),
tertiary: token-definition.get-mdc-tokens('fab-tertiary', $systems, $exclude-hardcoded)
);
@return token-definition.namespace-tokens(
$prefix, ($tokens, $variant-tokens), $token-slots);
}
| {
"end_byte": 1363,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_fab.scss"
} |
components/src/material/core/tokens/m3/mdc/_switch.scss_0_4858 | @use 'sass:map';
@use '../../../style/elevation';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mdc, switch);
/// Generates the tokens for MDC switch
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of tokens for the MDC switch
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: token-definition.get-mdc-tokens('switch', $systems, $exclude-hardcoded);
$elevation-tokens: (handle-elevation, disabled-handle-elevation);
@each $token in $elevation-tokens {
$elevation: map.get($tokens, $token);
@if ($elevation != null) {
$tokens: map.set($tokens, $token + '-shadow', elevation.get-box-shadow($elevation));
}
}
$variant-tokens: (
primary: (), // Default, no overrides needed
secondary: (
selected-focus-handle-color: map.get($systems, md-sys-color, secondary-container),
selected-focus-icon-color: map.get($systems, md-sys-color, on-secondary-container),
selected-focus-state-layer-color: map.get($systems, md-sys-color, secondary),
selected-focus-track-color: map.get($systems, md-sys-color, secondary),
selected-handle-color: map.get($systems, md-sys-color, on-secondary),
selected-hover-handle-color: map.get($systems, md-sys-color, secondary-container),
selected-hover-icon-color: map.get($systems, md-sys-color, on-secondary-container),
selected-hover-state-layer-color: map.get($systems, md-sys-color, secondary),
selected-hover-track-color: map.get($systems, md-sys-color, secondary),
selected-icon-color: map.get($systems, md-sys-color, on-secondary-container),
selected-pressed-handle-color: map.get($systems, md-sys-color, secondary-container),
selected-pressed-icon-color: map.get($systems, md-sys-color, on-secondary-container),
selected-pressed-state-layer-color: map.get($systems, md-sys-color, secondary),
selected-pressed-track-color: map.get($systems, md-sys-color, secondary),
selected-track-color: map.get($systems, md-sys-color, secondary),
),
tertiary: (
selected-focus-handle-color: map.get($systems, md-sys-color, tertiary-container),
selected-focus-icon-color: map.get($systems, md-sys-color, on-tertiary-container),
selected-focus-state-layer-color: map.get($systems, md-sys-color, tertiary),
selected-focus-track-color: map.get($systems, md-sys-color, tertiary),
selected-handle-color: map.get($systems, md-sys-color, on-tertiary),
selected-hover-handle-color: map.get($systems, md-sys-color, tertiary-container),
selected-hover-icon-color: map.get($systems, md-sys-color, on-tertiary-container),
selected-hover-state-layer-color: map.get($systems, md-sys-color, tertiary),
selected-hover-track-color: map.get($systems, md-sys-color, tertiary),
selected-icon-color: map.get($systems, md-sys-color, on-tertiary-container),
selected-pressed-handle-color: map.get($systems, md-sys-color, tertiary-container),
selected-pressed-icon-color: map.get($systems, md-sys-color, on-tertiary-container),
selected-pressed-state-layer-color: map.get($systems, md-sys-color, tertiary),
selected-pressed-track-color: map.get($systems, md-sys-color, tertiary),
selected-track-color: map.get($systems, md-sys-color, tertiary),
),
error: (
selected-focus-handle-color: map.get($systems, md-sys-color, error-container),
selected-focus-icon-color: map.get($systems, md-sys-color, on-error-container),
selected-focus-state-layer-color: map.get($systems, md-sys-color, error),
selected-focus-track-color: map.get($systems, md-sys-color, error),
selected-handle-color: map.get($systems, md-sys-color, on-error),
selected-hover-handle-color: map.get($systems, md-sys-color, error-container),
selected-hover-icon-color: map.get($systems, md-sys-color, on-error-container),
selected-hover-state-layer-color: map.get($systems, md-sys-color, error),
selected-hover-track-color: map.get($systems, md-sys-color, error),
selected-icon-color: map.get($systems, md-sys-color, on-error-container),
selected-pressed-handle-color: map.get($systems, md-sys-color, error-container),
selected-pressed-icon-color: map.get($systems, md-sys-color, on-error-container),
selected-pressed-state-layer-color: map.get($systems, md-sys-color, error),
selected-pressed-track-color: map.get($systems, md-sys-color, error),
selected-track-color: map.get($systems, md-sys-color, error),
),
);
@return token-definition.namespace-tokens(
$prefix, ($tokens, $variant-tokens), $token-slots);
}
| {
"end_byte": 4858,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mdc/_switch.scss"
} |
components/src/material/core/tokens/m3/mat/_tab-header.scss_0_2474 | @use 'sass:map';
@use '../../../style/sass-utils';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, tab-header);
/// Generates custom tokens for the mat-tab-header.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-tab-header
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: sass-utils.merge-all(
token-definition.generate-typography-tokens($systems, label-text, title-small),
(
divider-color: map.get($systems, md-sys-color, surface-variant),
divider-height: token-definition.hardcode(1px, $exclude-hardcoded),
disabled-ripple-color: null, // TODO(mmalerba): Figure out correct value.
pagination-icon-color: map.get($systems, md-sys-color, on-surface),
inactive-label-text-color: map.get($systems, md-sys-color, on-surface),
active-label-text-color: map.get($systems, md-sys-color, on-surface),
active-ripple-color: map.get($systems, md-sys-color, on-surface),
inactive-ripple-color: map.get($systems, md-sys-color, on-surface),
inactive-focus-label-text-color: map.get($systems, md-sys-color, on-surface),
inactive-hover-label-text-color: map.get($systems, md-sys-color, on-surface),
active-focus-label-text-color: map.get($systems, md-sys-color, on-surface),
active-hover-label-text-color: map.get($systems, md-sys-color, on-surface),
active-focus-indicator-color: map.get($systems, md-sys-color, primary),
active-hover-indicator-color: map.get($systems, md-sys-color, primary),
),
), (
// Color variants
primary: (), // Default, no overrides needed
secondary: (
active-focus-indicator-color: map.get($systems, md-sys-color, secondary),
active-hover-indicator-color: map.get($systems, md-sys-color, secondary),
),
tertiary: (
active-focus-indicator-color: map.get($systems, md-sys-color, tertiary),
active-hover-indicator-color: map.get($systems, md-sys-color, tertiary),
),
error: (
active-focus-indicator-color: map.get($systems, md-sys-color, error),
active-hover-indicator-color: map.get($systems, md-sys-color, error),
)
);
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 2474,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_tab-header.scss"
} |
components/src/material/core/tokens/m3/mat/_optgroup.scss_0_842 | @use 'sass:map';
@use '../../../style/sass-utils';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, optgroup);
/// Generates custom tokens for the mat-optgroup.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-optgroup
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: sass-utils.merge-all(
token-definition.generate-typography-tokens($systems, label-text, title-small),
(
label-text-color: map.get($systems, md-sys-color, on-surface-variant),
)
);
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 842,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_optgroup.scss"
} |
components/src/material/core/tokens/m3/mat/_select.scss_0_1987 | @use 'sass:map';
@use '../../../style/sass-utils';
@use '../../../style/elevation';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, select);
/// Generates custom tokens for the mat-select.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-select
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: sass-utils.merge-all(
token-definition.generate-typography-tokens($systems, trigger-text, body-large),
(
panel-background-color: map.get($systems, md-sys-color, surface-container),
enabled-trigger-text-color: map.get($systems, md-sys-color, on-surface),
disabled-trigger-text-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
placeholder-text-color: map.get($systems, md-sys-color, on-surface-variant),
enabled-arrow-color: map.get($systems, md-sys-color, on-surface-variant),
disabled-arrow-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
focused-arrow-color: map.get($systems, md-sys-color, primary),
invalid-arrow-color: map.get($systems, md-sys-color, error),
container-elevation-shadow:
token-definition.hardcode(elevation.get-box-shadow(2), $exclude-hardcoded),
)
), (
// Color variants:
primary: (), // Default, no overrides needed
secondary: (
focused-arrow-color: map.get($systems, md-sys-color, secondary),
),
tertiary: (
focused-arrow-color: map.get($systems, md-sys-color, tertiary),
),
error: (
focused-arrow-color: map.get($systems, md-sys-color, error),
)
);
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 1987,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_select.scss"
} |
components/src/material/core/tokens/m3/mat/_expansion.scss_0_2126 | @use 'sass:map';
@use '../../../style/sass-utils';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, expansion);
/// Generates custom tokens for the mat-expansion.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-expansion
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: sass-utils.merge-all(
token-definition.generate-typography-tokens($systems, header-text, title-medium),
token-definition.generate-typography-tokens($systems, container-text, body-large),
(
container-shape: token-definition.hardcode(12px, $exclude-hardcoded),
legacy-header-indicator-display: token-definition.hardcode(none, $exclude-hardcoded),
header-indicator-display: token-definition.hardcode(inline-block, $exclude-hardcoded),
container-background-color: map.get($systems, md-sys-color, surface),
container-text-color: map.get($systems, md-sys-color, on-surface),
actions-divider-color: map.get($systems, md-sys-color, outline),
header-hover-state-layer-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-surface),
$alpha: map.get($systems, md-sys-state, hover-state-layer-opacity)
),
header-focus-state-layer-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-surface),
$alpha: map.get($systems, md-sys-state, focus-state-layer-opacity)
),
header-disabled-state-text-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
header-text-color: map.get($systems, md-sys-color, on-surface),
header-description-color: map.get($systems, md-sys-color, on-surface-variant),
header-indicator-color: map.get($systems, md-sys-color, on-surface-variant),
)
);
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 2126,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_expansion.scss"
} |
components/src/material/core/tokens/m3/mat/_stepper.scss_0_4781 | @use 'sass:map';
@use '../../../style/sass-utils';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, stepper);
/// Generates custom tokens for the mat-stepper.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-stepper
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: (
(
container-color: map.get($systems, md-sys-color, surface),
line-color: map.get($systems, md-sys-color, outline),
header-hover-state-layer-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, inverse-surface),
$alpha: map.get($systems, md-sys-state, hover-state-layer-opacity)
),
header-focus-state-layer-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, inverse-surface),
$alpha: map.get($systems, md-sys-state, focus-state-layer-opacity)
),
header-label-text-color: map.get($systems, md-sys-color, on-surface-variant),
header-optional-label-text-color: map.get($systems, md-sys-color, on-surface-variant),
header-selected-state-label-text-color: map.get($systems, md-sys-color, on-surface-variant),
header-icon-background-color: map.get($systems, md-sys-color, on-surface-variant),
header-icon-foreground-color: map.get($systems, md-sys-color, surface),
header-edit-state-icon-background-color: map.get($systems, md-sys-color, primary),
header-edit-state-icon-foreground-color: map.get($systems, md-sys-color, on-primary),
header-error-state-label-text-color: map.get($systems, md-sys-color, error),
header-error-state-icon-foreground-color: map.get($systems, md-sys-color, error),
header-error-state-icon-background-color:
token-definition.hardcode(transparent, $exclude-hardcoded),
container-text-font: map.get($systems, md-sys-typescale, body-medium-font),
header-label-text-font: map.get($systems, md-sys-typescale, title-small-font),
header-label-text-size: map.get($systems, md-sys-typescale, title-small-size),
header-label-text-weight: map.get($systems, md-sys-typescale, title-small-weight),
header-error-state-label-text-size: map.get($systems, md-sys-typescale, title-small-size),
header-focus-state-layer-shape: map.get($systems, md-sys-shape, corner-medium),
header-hover-state-layer-shape: map.get($systems, md-sys-shape, corner-medium),
header-selected-state-label-text-size: map.get($systems, md-sys-typescale, title-small-size),
header-selected-state-label-text-weight: map.get(
$systems, md-sys-typescale, title-small-weight),
header-selected-state-icon-background-color: map.get($systems, md-sys-color, primary),
header-selected-state-icon-foreground-color: map.get($systems, md-sys-color, on-primary),
), (
// Color variants
primary: (
header-edit-state-icon-background-color: map.get($systems, md-sys-color, primary),
header-edit-state-icon-foreground-color: map.get($systems, md-sys-color, on-primary),
header-selected-state-icon-background-color: map.get($systems, md-sys-color, primary),
header-selected-state-icon-foreground-color: map.get($systems, md-sys-color, on-primary),
),
secondary: (
header-edit-state-icon-background-color: map.get($systems, md-sys-color, secondary),
header-edit-state-icon-foreground-color: map.get($systems, md-sys-color, on-secondary),
header-selected-state-icon-background-color: map.get($systems, md-sys-color, secondary),
header-selected-state-icon-foreground-color: map.get($systems, md-sys-color, on-secondary),
),
tertiary: (
header-edit-state-icon-background-color: map.get($systems, md-sys-color, tertiary),
header-edit-state-icon-foreground-color: map.get($systems, md-sys-color, on-tertiary),
header-selected-state-icon-background-color: map.get($systems, md-sys-color, tertiary),
header-selected-state-icon-foreground-color: map.get($systems, md-sys-color, on-tertiary),
),
error: (
header-edit-state-icon-background-color: map.get($systems, md-sys-color, error),
header-edit-state-icon-foreground-color: map.get($systems, md-sys-color, on-error),
header-selected-state-icon-background-color: map.get($systems, md-sys-color, error),
header-selected-state-icon-foreground-color: map.get($systems, md-sys-color, on-error),
)
)
);
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 4781,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_stepper.scss"
} |
components/src/material/core/tokens/m3/mat/_checkbox.scss_0_1235 | @use 'sass:map';
@use '../../../style/sass-utils';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, checkbox);
/// Generates custom tokens for mat-checkbox.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for mat-checkbox
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: (
disabled-label-color:
sass-utils.safe-color-change(map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
label-text-color: map.get($systems, md-sys-color, on-surface),
label-text-font: map.get($systems, md-sys-typescale, body-medium-font),
label-text-line-height: map.get($systems, md-sys-typescale, body-medium-line-height),
label-text-size: map.get($systems, md-sys-typescale, body-medium-size),
label-text-tracking: map.get($systems, md-sys-typescale, body-medium-tracking),
label-text-weight: map.get($systems, md-sys-typescale, body-medium-weight),
);
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 1235,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_checkbox.scss"
} |
components/src/material/core/tokens/m3/mat/_sidenav.scss_0_1386 | @use 'sass:map';
@use '../../../style/sass-utils';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, sidenav);
/// Generates custom tokens for the mat-sidenav.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-sidenav
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: (
container-elevation-shadow: token-definition.hardcode(none, $exclude-hardcoded),
container-divider-color: token-definition.hardcode(transparent, $exclude-hardcoded),
container-width: token-definition.hardcode(360px, $exclude-hardcoded),
container-shape: map.get($systems, md-sys-shape, corner-large),
container-background-color: map.get($systems, md-sys-color, surface),
container-text-color: map.get($systems, md-sys-color, on-surface-variant),
content-background-color: map.get($systems, md-sys-color, background),
content-text-color: map.get($systems, md-sys-color, on-background),
scrim-color: sass-utils.safe-color-change(
map.get($systems, md-ref-palette, neutral-variant20), $alpha: 0.4),
);
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 1386,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_sidenav.scss"
} |
components/src/material/core/tokens/m3/mat/_badge.scss_0_4216 | @use 'sass:map';
@use '../../../style/sass-utils';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, badge);
/// Generates custom tokens for the mat-badge.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-badge
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: ((
background-color: map.get($systems, md-sys-color, error),
text-color: map.get($systems, md-sys-color, on-error),
disabled-state-background-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, error),
$alpha: 0.38,
),
disabled-state-text-color: map.get($systems, md-sys-color, on-error),
text-font: map.get($systems, md-sys-typescale, label-small-font),
text-size: map.get($systems, md-sys-typescale, label-small-size),
text-weight: map.get($systems, md-sys-typescale, label-small-weight),
small-size-text-size: token-definition.hardcode(0, $exclude-hardcoded),
container-shape: map.get($systems, md-sys-shape, corner-full),
container-size: token-definition.hardcode(16px, $exclude-hardcoded),
line-height: token-definition.hardcode(16px, $exclude-hardcoded),
legacy-container-size: token-definition.hardcode(unset, $exclude-hardcoded),
legacy-small-size-container-size: token-definition.hardcode(unset, $exclude-hardcoded),
small-size-container-size: token-definition.hardcode(6px, $exclude-hardcoded),
small-size-line-height: token-definition.hardcode(6px, $exclude-hardcoded),
container-padding: token-definition.hardcode(0 4px, $exclude-hardcoded),
small-size-container-padding: token-definition.hardcode(0, $exclude-hardcoded),
container-offset: token-definition.hardcode(-12px 0, $exclude-hardcoded),
small-size-container-offset: token-definition.hardcode(-6px 0, $exclude-hardcoded),
container-overlap-offset: token-definition.hardcode(-12px, $exclude-hardcoded),
small-size-container-overlap-offset: token-definition.hardcode(-6px, $exclude-hardcoded),
// This size isn't in the M3 spec so we emit the same values as for `medium`.
large-size-container-size: token-definition.hardcode(16px, $exclude-hardcoded),
large-size-line-height: token-definition.hardcode(16px, $exclude-hardcoded),
large-size-container-offset: token-definition.hardcode(-12px 0, $exclude-hardcoded),
large-size-container-overlap-offset: token-definition.hardcode(-12px, $exclude-hardcoded),
large-size-text-size: map.get($systems, md-sys-typescale, label-small-size),
large-size-container-padding: token-definition.hardcode(0 4px, $exclude-hardcoded),
legacy-large-size-container-size: token-definition.hardcode(unset, $exclude-hardcoded),
), (
primary: (
background-color: map.get($systems, md-sys-color, primary),
text-color: map.get($systems, md-sys-color, on-primary),
disabled-state-background-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, primary),
$alpha: 0.38,
),
disabled-state-text-color: map.get($systems, md-sys-color, on-primary),
),
secondary: (
background-color: map.get($systems, md-sys-color, secondary),
text-color: map.get($systems, md-sys-color, on-secondary),
disabled-state-background-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, secondary),
$alpha: 0.38,
),
disabled-state-text-color: map.get($systems, md-sys-color, on-secondary),
),
tertiary: (
background-color: map.get($systems, md-sys-color, tertiary),
text-color: map.get($systems, md-sys-color, on-tertiary),
disabled-state-background-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, tertiary),
$alpha: 0.38,
),
disabled-state-text-color: map.get($systems, md-sys-color, on-tertiary),
),
error: () // Default, no overrides needed
));
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 4216,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_badge.scss"
} |
components/src/material/core/tokens/m3/mat/_protected-button.scss_0_2458 | @use 'sass:map';
@use '../../../style/sass-utils';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
// Note: in M3 the "protected" button is called "elevated".
$prefix: (mat, protected-button);
/// Generates custom tokens for the mat-raised-button.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-raised-button
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: ((
horizontal-padding: token-definition.hardcode(24px, $exclude-hardcoded),
icon-spacing: token-definition.hardcode(8px, $exclude-hardcoded),
icon-offset: token-definition.hardcode(-8px, $exclude-hardcoded),
state-layer-color: map.get($systems, md-sys-color, primary),
disabled-state-layer-color: map.get($systems, md-sys-color, on-surface-variant),
ripple-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, primary),
$alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
),
hover-state-layer-opacity: map.get($systems, md-sys-state, hover-state-layer-opacity),
focus-state-layer-opacity: map.get($systems, md-sys-state, focus-state-layer-opacity),
pressed-state-layer-opacity: map.get($systems, md-sys-state, pressed-state-layer-opacity),
), (
// Color variants:
primary: (), // Default, no overrides needed.
secondary: (
state-layer-color: map.get($systems, md-sys-color, secondary),
ripple-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, secondary),
$alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
),
),
tertiary: (
state-layer-color: map.get($systems, md-sys-color, tertiary),
ripple-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, tertiary),
$alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
),
),
error: (
state-layer-color: map.get($systems, md-sys-color, error),
ripple-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, error),
$alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
),
)
));
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 2458,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_protected-button.scss"
} |
components/src/material/core/tokens/m3/mat/_timepicker.scss_0_926 | @use 'sass:map';
@use '../../../style/elevation';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, timepicker);
/// Generates custom tokens for the mat-timepicker.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-timepicker
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: (
container-background-color: map.get($systems, md-sys-color, surface-container),
container-shape: map.get($systems, md-sys-shape, corner-extra-small),
container-elevation-shadow:
token-definition.hardcode(elevation.get-box-shadow(2), $exclude-hardcoded),
);
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 926,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_timepicker.scss"
} |
components/src/material/core/tokens/m3/mat/_grid-list.scss_0_960 | @use 'sass:map';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, grid-list);
/// Generates custom tokens for the mat-grid-list.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-grid-list
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: (
tile-header-primary-text-size: map.get($systems, md-sys-typescale, body-large),
tile-header-secondary-text-size: map.get($systems, md-sys-typescale, body-medium),
tile-footer-primary-text-size: map.get($systems, md-sys-typescale, body-large),
tile-footer-secondary-text-size: map.get($systems, md-sys-typescale, body-medium),
);
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 960,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_grid-list.scss"
} |
components/src/material/core/tokens/m3/mat/_option.scss_0_2789 | @use 'sass:map';
@use '../../../style/sass-utils';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, option);
/// Generates custom tokens for the mat-option.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-option
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: ((
selected-state-label-text-color: map.get($systems, md-sys-color, on-secondary-container),
label-text-color: map.get($systems, md-sys-color, on-surface),
hover-state-layer-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-surface),
$alpha: map.get($systems, md-sys-state, hover-state-layer-opacity)
),
focus-state-layer-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-surface),
$alpha: map.get($systems, md-sys-state, focus-state-layer-opacity)
),
selected-state-layer-color: map.get($systems, md-sys-color, secondary-container),
// According to the spec the options have to be `label-large` in all typography
// dimensions, however this is inconsistent with the designs and with MDC's
// own implementation. This appears to be a bug in the spec, because MDC overrides
// the font size and weight to be `body-large` (see b/261838263). We make the same
// override here so the label looks correct.
label-text-size: map.get($systems, md-sys-typescale, body-large-size),
label-text-weight: map.get($systems, md-sys-typescale, body-large-weight),
label-text-font: map.get($systems, md-sys-typescale, label-large-font),
label-text-line-height: map.get($systems, md-sys-typescale, label-large-line-height),
label-text-tracking: map.get($systems, md-sys-typescale, label-large-tracking),
), (
// Color variants:
primary: (
selected-state-label-text-color: map.get($systems, md-sys-color, on-primary-container),
selected-state-layer-color: map.get($systems, md-sys-color, primary-container),
),
secondary: (), // Default, no overrides needed
tertiary: (
selected-state-label-text-color: map.get($systems, md-sys-color, on-tertiary-container),
selected-state-layer-color: map.get($systems, md-sys-color, tertiary-container),
),
error: (
selected-state-label-text-color: map.get($systems, md-sys-color, on-error-container),
selected-state-layer-color: map.get($systems, md-sys-color, error-container),
)
));
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 2789,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_option.scss"
} |
components/src/material/core/tokens/m3/mat/_full-pseudo-checkbox.scss_0_1816 | @use 'sass:map';
@use '../../../style/sass-utils';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, full-pseudo-checkbox);
/// Generates custom tokens for the full variant of mat-pseudo-checkbox.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the full variant of mat-pseudo-checkbox
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$disabled-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-surface), $alpha: 0.38);
$tokens: ((
selected-icon-color: map.get($systems, md-sys-color, primary),
selected-checkmark-color: map.get($systems, md-sys-color, on-primary),
unselected-icon-color: map.get($systems, md-sys-color, on-surface-variant),
disabled-selected-checkmark-color: map.get($systems, md-sys-color, surface),
disabled-unselected-icon-color: $disabled-color,
disabled-selected-icon-color: $disabled-color,
), (
// Color variants:
primary: (), // Default, no overrides needed.
secondary: (
selected-icon-color: map.get($systems, md-sys-color, secondary),
selected-checkmark-color: map.get($systems, md-sys-color, on-secondary),
),
tertiary: (
selected-icon-color: map.get($systems, md-sys-color, tertiary),
selected-checkmark-color: map.get($systems, md-sys-color, on-tertiary),
),
error: (
selected-icon-color: map.get($systems, md-sys-color, error),
selected-checkmark-color: map.get($systems, md-sys-color, on-error),
)
));
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 1816,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_full-pseudo-checkbox.scss"
} |
components/src/material/core/tokens/m3/mat/_radio.scss_0_1799 | @use 'sass:map';
@use '../../../style/sass-utils';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, radio);
/// Generates custom tokens for the mat-radio.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-radio
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: (
(
ripple-color: map.get($systems, md-sys-color, on-surface),
checked-ripple-color: map.get($systems, md-sys-color, primary),
disabled-label-color:
sass-utils.safe-color-change(map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
label-text-color: map.get($systems, md-sys-color, on-surface),
label-text-font: map.get($systems, md-sys-typescale, body-medium-font),
label-text-line-height: map.get($systems, md-sys-typescale, body-medium-line-height),
label-text-size: map.get($systems, md-sys-typescale, body-medium-size),
label-text-tracking: map.get($systems, md-sys-typescale, body-medium-tracking),
label-text-weight: map.get($systems, md-sys-typescale, body-medium-weight),
),
(
// Color variants:
primary: (),
// Default, no overrides needed
secondary:
(
checked-ripple-color: map.get($systems, md-sys-color, secondary),
),
tertiary: (
checked-ripple-color: map.get($systems, md-sys-color, tertiary),
),
error: (
checked-ripple-color: map.get($systems, md-sys-color, error),
)
)
);
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 1799,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_radio.scss"
} |
components/src/material/core/tokens/m3/mat/_chip.scss_0_2205 | @use 'sass:map';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, chip);
/// Generates custom tokens for the mat-chip.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-chip
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: ((
disabled-container-opacity: token-definition.hardcode(1, $exclude-hardcoded),
selected-trailing-icon-color: map.get($systems, md-sys-color, on-secondary-container),
selected-disabled-trailing-icon-color: map.get($systems, md-sys-color, on-surface),
trailing-action-state-layer-color: map.get($systems, md-sys-color, on-surface-variant),
selected-trailing-action-state-layer-color:
map.get($systems, md-sys-color, on-secondary-container),
trailing-action-hover-state-layer-opacity:
map.get($systems, md-sys-state, hover-state-layer-opacity),
trailing-action-focus-state-layer-opacity:
map.get($systems, md-sys-state, focus-state-layer-opacity),
trailing-action-opacity: token-definition.hardcode(1, $exclude-hardcoded),
trailing-action-focus-opacity: token-definition.hardcode(1, $exclude-hardcoded),
), (
primary: (
selected-trailing-icon-color: map.get($systems, md-sys-color, on-primary-container),
selected-trailing-action-state-layer-color:
map.get($systems, md-sys-color, on-primary-container),
),
secondary: (), // Default, no overrides needed.
tertiary: (
selected-trailing-icon-color: map.get($systems, md-sys-color, on-tertiary-container),
selected-trailing-action-state-layer-color:
map.get($systems, md-sys-color, on-tertiary-container),
),
error: (
selected-trailing-icon-color: map.get($systems, md-sys-color, on-error-container),
selected-trailing-action-state-layer-color:
map.get($systems, md-sys-color, on-error-container),
),
));
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 2205,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_chip.scss"
} |
components/src/material/core/tokens/m3/mat/_text-button.scss_0_2463 | @use 'sass:map';
@use '../../../style/sass-utils';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, text-button);
/// Generates custom tokens for the mat-button.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-button
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: ((
horizontal-padding: token-definition.hardcode(12px, $exclude-hardcoded),
with-icon-horizontal-padding: token-definition.hardcode(16px, $exclude-hardcoded),
icon-spacing: token-definition.hardcode(8px, $exclude-hardcoded),
icon-offset: token-definition.hardcode(-4px, $exclude-hardcoded),
state-layer-color: map.get($systems, md-sys-color, primary),
disabled-state-layer-color: map.get($systems, md-sys-color, on-surface-variant),
ripple-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, primary),
$alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
),
hover-state-layer-opacity: map.get($systems, md-sys-state, hover-state-layer-opacity),
focus-state-layer-opacity: map.get($systems, md-sys-state, focus-state-layer-opacity),
pressed-state-layer-opacity: map.get($systems, md-sys-state, pressed-state-layer-opacity),
), (
// Color variants:
primary: (), // Default, no overrides needed.
secondary: (
state-layer-color: map.get($systems, md-sys-color, secondary),
ripple-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, secondary),
$alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
)
),
tertiary: (
state-layer-color: map.get($systems, md-sys-color, tertiary),
ripple-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, tertiary),
$alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
)
),
error: (
state-layer-color: map.get($systems, md-sys-color, error),
ripple-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, error),
$alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
)
)
));
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 2463,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_text-button.scss"
} |
components/src/material/core/tokens/m3/mat/_datepicker.scss_0_7312 | @use 'sass:map';
@use '../../../style/elevation';
@use '../../../style/sass-utils';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, datepicker);
/// Generates custom tokens for the mat-datepicker.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-datepicker
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: ((
calendar-date-in-range-state-background-color:
map.get($systems, md-sys-color, primary-container),
calendar-date-in-comparison-range-state-background-color:
map.get($systems, md-sys-color, tertiary-container),
calendar-date-in-overlap-range-state-background-color:
map.get($systems, md-sys-color, secondary-container),
calendar-date-in-overlap-range-selected-state-background-color:
map.get($systems, md-sys-color, secondary),
calendar-date-selected-state-text-color: map.get($systems, md-sys-color, on-primary),
calendar-date-selected-state-background-color: map.get($systems, md-sys-color, primary),
calendar-date-selected-disabled-state-background-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-surface),
$alpha: 0.38
),
calendar-date-today-selected-state-outline-color: map.get($systems, md-sys-color, primary),
calendar-date-focus-state-background-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-surface),
$alpha: map.get($systems, md-sys-state, focus-state-layer-opacity)
),
calendar-date-hover-state-background-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-surface),
$alpha: map.get($systems, md-sys-state, hover-state-layer-opacity)
),
toggle-active-state-icon-color: map.get($systems, md-sys-color, on-surface-variant),
toggle-icon-color: map.get($systems, md-sys-color, on-surface-variant),
calendar-body-label-text-color: map.get($systems, md-sys-color, on-surface),
calendar-period-button-text-color: map.get($systems, md-sys-color, on-surface-variant),
calendar-period-button-icon-color: map.get($systems, md-sys-color, on-surface-variant),
calendar-navigation-button-icon-color: map.get($systems, md-sys-color, on-surface-variant),
calendar-header-divider-color: token-definition.hardcode(transparent, $exclude-hardcoded),
calendar-header-text-color: map.get($systems, md-sys-color, on-surface-variant),
calendar-date-today-outline-color: map.get($systems, md-sys-color, primary),
calendar-date-today-disabled-state-outline-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-surface),
$alpha: 0.38
),
calendar-date-text-color: map.get($systems, md-sys-color, on-surface),
calendar-date-outline-color: token-definition.hardcode(transparent, $exclude-hardcoded),
calendar-date-disabled-state-text-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-surface),
$alpha: 0.38
),
calendar-date-preview-state-outline-color: map.get($systems, md-sys-color, primary),
range-input-separator-color: map.get($systems, md-sys-color, on-surface),
range-input-disabled-state-separator-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-surface),
$alpha: 0.38
),
range-input-disabled-state-text-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-surface),
$alpha: 0.38
),
calendar-container-background-color: map.get($systems, md-sys-color, surface-container-high),
calendar-container-text-color: map.get($systems, md-sys-color, on-surface),
calendar-container-elevation-shadow:
token-definition.hardcode(elevation.get-box-shadow(0), $exclude-hardcoded),
calendar-container-touch-elevation-shadow:
token-definition.hardcode(elevation.get-box-shadow(0), $exclude-hardcoded),
calendar-container-shape: map.get($systems, md-sys-shape, corner-large),
calendar-container-touch-shape: map.get($systems, md-sys-shape, corner-extra-large),
calendar-text-font: map.get($systems, md-sys-typescale, body-medium-font),
calendar-text-size: map.get($systems, md-sys-typescale, body-medium-size),
calendar-body-label-text-size: map.get($systems, md-sys-typescale, title-small-size),
calendar-body-label-text-weight: map.get($systems, md-sys-typescale, title-small-weight),
calendar-period-button-text-size: map.get($systems, md-sys-typescale, title-small-size),
calendar-period-button-text-weight: map.get($systems, md-sys-typescale, title-small-weight),
calendar-header-text-size: map.get($systems, md-sys-typescale, title-small-size),
calendar-header-text-weight: map.get($systems, md-sys-typescale, title-small-weight),
), (
// Color variants:
primary: (), // Default, no overrides needed.
secondary: (
calendar-date-in-range-state-background-color:
map.get($systems, md-sys-color, secondary-container),
calendar-date-selected-state-text-color: map.get($systems, md-sys-color, on-secondary),
calendar-date-selected-state-background-color: map.get($systems, md-sys-color, secondary),
calendar-date-today-selected-state-outline-color: map.get($systems, md-sys-color, secondary),
calendar-date-today-outline-color: map.get($systems, md-sys-color, secondary),
calendar-date-preview-state-outline-color: map.get($systems, md-sys-color, secondary),
calendar-date-in-overlap-range-state-background-color:
map.get($systems, md-sys-color, primary-container),
calendar-date-in-overlap-range-selected-state-background-color:
map.get($systems, md-sys-color, primary),
),
tertiary: (
calendar-date-in-range-state-background-color:
map.get($systems, md-sys-color, tertiary-container),
calendar-date-selected-state-text-color: map.get($systems, md-sys-color, on-tertiary),
calendar-date-selected-state-background-color: map.get($systems, md-sys-color, tertiary),
calendar-date-today-selected-state-outline-color: map.get($systems, md-sys-color, tertiary),
calendar-date-today-outline-color: map.get($systems, md-sys-color, tertiary),
calendar-date-preview-state-outline-color: map.get($systems, md-sys-color, tertiary),
calendar-date-in-comparison-range-state-background-color:
map.get($systems, md-sys-color, primary-container),
),
error: (
calendar-date-in-range-state-background-color:
map.get($systems, md-sys-color, error-container),
calendar-date-selected-state-text-color: map.get($systems, md-sys-color, on-error),
calendar-date-selected-state-background-color: map.get($systems, md-sys-color, error),
calendar-date-today-selected-state-outline-color: map.get($systems, md-sys-color, error),
calendar-date-today-outline-color: map.get($systems, md-sys-color, error),
calendar-date-preview-state-outline-color: map.get($systems, md-sys-color, error),
)
));
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 7312,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_datepicker.scss"
} |
components/src/material/core/tokens/m3/mat/_outlined-button.scss_0_2401 | @use 'sass:map';
@use '../../../style/sass-utils';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, outlined-button);
/// Generates custom tokens for the mat-outlined-button.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-outlined-button
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: ((
horizontal-padding: token-definition.hardcode(24px, $exclude-hardcoded),
icon-spacing: token-definition.hardcode(8px, $exclude-hardcoded),
icon-offset: token-definition.hardcode(-8px, $exclude-hardcoded),
state-layer-color: map.get($systems, md-sys-color, primary),
disabled-state-layer-color: map.get($systems, md-sys-color, on-surface-variant),
ripple-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, primary),
$alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
),
hover-state-layer-opacity: map.get($systems, md-sys-state, hover-state-layer-opacity),
focus-state-layer-opacity: map.get($systems, md-sys-state, focus-state-layer-opacity),
pressed-state-layer-opacity: map.get($systems, md-sys-state, pressed-state-layer-opacity),
), (
// Color variants:
primary: (), // Default, no overrides needed.
secondary: (
state-layer-color: map.get($systems, md-sys-color, secondary),
ripple-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, secondary),
$alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
),
),
tertiary: (
state-layer-color: map.get($systems, md-sys-color, tertiary),
ripple-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, tertiary),
$alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
),
),
error: (
state-layer-color: map.get($systems, md-sys-color, error),
ripple-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, error),
$alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
),
)
));
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 2401,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_outlined-button.scss"
} |
components/src/material/core/tokens/m3/mat/_table.scss_0_1332 | @use 'sass:map';
@use '../../../style/sass-utils';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, table);
/// Generates custom tokens for the mat-table.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-table
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: sass-utils.merge-all(
token-definition.generate-typography-tokens($systems, header-headline, title-small),
token-definition.generate-typography-tokens($systems, row-item-label-text, body-medium),
token-definition.generate-typography-tokens(
$systems, footer-supporting-text, body-medium),
(
row-item-outline-width: token-definition.hardcode(1px, $exclude-hardcoded),
background-color: map.get($systems, md-sys-color, surface),
header-headline-color: map.get($systems, md-sys-color, on-surface),
row-item-label-text-color: map.get($systems, md-sys-color, on-surface),
row-item-outline-color: map.get($systems, md-sys-color, outline),
),
);
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 1332,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_table.scss"
} |
components/src/material/core/tokens/m3/mat/_dialog.scss_0_1757 | @use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, dialog);
/// Generates custom tokens for the dialog.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the dialog
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: (
container-elevation-shadow: token-definition.hardcode(none, $exclude-hardcoded),
container-max-width: token-definition.hardcode(560px, $exclude-hardcoded),
container-small-max-width:
token-definition.hardcode(calc(100vw - 32px), $exclude-hardcoded),
container-min-width: token-definition.hardcode(280px, $exclude-hardcoded),
actions-alignment: token-definition.hardcode(flex-end, $exclude-hardcoded),
content-padding: token-definition.hardcode(20px 24px, $exclude-hardcoded),
with-actions-content-padding: token-definition.hardcode(20px 24px 0, $exclude-hardcoded),
actions-padding: token-definition.hardcode(16px 24px, $exclude-hardcoded),
// The vertical padding values are a bit weird, because MDC uses a `::before` pseudo
// element to size the title which in turn means that we can't set a specific padding
// and get the exact same space out of it. These values were determined through
// trial and error so that the first line of text is 24px from the top and the bottom
// of the text is 16px from the content under it.
headline-padding: token-definition.hardcode(6px 24px 13px, $exclude-hardcoded),
);
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 1757,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_dialog.scss"
} |
components/src/material/core/tokens/m3/mat/_bottom-sheet.scss_0_1020 | @use 'sass:map';
@use '../../../style/sass-utils';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, bottom-sheet);
/// Generates custom tokens for the mat-bottom-sheet.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-bottom-sheet
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: sass-utils.merge-all(
token-definition.generate-typography-tokens($systems, container-text, body-large),
(
container-shape: token-definition.hardcode(28px, $exclude-hardcoded),
container-text-color: map.get($systems, md-sys-color, on-surface),
container-background-color: map.get($systems, md-sys-color, surface-container-low),
),
);
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 1020,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_bottom-sheet.scss"
} |
components/src/material/core/tokens/m3/mat/_paginator.scss_0_1212 | @use 'sass:map';
@use '../../../style/sass-utils';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, paginator);
/// Generates custom tokens for the mat-paginator.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-paginator
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: sass-utils.merge-all(
token-definition.generate-typography-tokens($systems, container-text, body-small),
(
container-text-color: map.get($systems, md-sys-color, on-surface),
container-background-color: map.get($systems, md-sys-color, surface),
enabled-icon-color: map.get($systems, md-sys-color, on-surface-variant),
disabled-icon-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
select-trigger-text-size: map.get($systems, md-sys-typescale, body-small-size),
)
);
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 1212,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_paginator.scss"
} |
components/src/material/core/tokens/m3/mat/_filled-button.scss_0_2415 | @use 'sass:map';
@use '../../../style/sass-utils';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, filled-button);
/// Generates custom tokens for the mat-flat-button.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-flat-button
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: ((
horizontal-padding: token-definition.hardcode(24px, $exclude-hardcoded),
icon-spacing: token-definition.hardcode(8px, $exclude-hardcoded),
icon-offset: token-definition.hardcode(-8px, $exclude-hardcoded),
state-layer-color: map.get($systems, md-sys-color, on-primary),
disabled-state-layer-color: map.get($systems, md-sys-color, on-surface-variant),
ripple-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-primary),
$alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
),
hover-state-layer-opacity: map.get($systems, md-sys-state, hover-state-layer-opacity),
focus-state-layer-opacity: map.get($systems, md-sys-state, focus-state-layer-opacity),
pressed-state-layer-opacity: map.get($systems, md-sys-state, pressed-state-layer-opacity),
), (
// Color variants:
primary: (), // Default, no overrides needed.
secondary: (
state-layer-color: map.get($systems, md-sys-color, on-secondary),
ripple-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-secondary),
$alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
),
),
tertiary: (
state-layer-color: map.get($systems, md-sys-color, on-tertiary),
ripple-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-tertiary),
$alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
),
),
error: (
state-layer-color: map.get($systems, md-sys-color, on-error),
ripple-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-error),
$alpha: map.get($systems, md-sys-state, pressed-state-layer-opacity)
),
)
));
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 2415,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_filled-button.scss"
} |
components/src/material/core/tokens/m3/mat/_list.scss_0_759 | @use 'sass:map';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, list);
/// Generates custom tokens for the mat-list.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-list
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: (
active-indicator-color: map.get($systems, md-sys-color, secondary-container),
active-indicator-shape: map.get($systems, md-sys-shape, corner-full),
);
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 759,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_list.scss"
} |
components/src/material/core/tokens/m3/mat/_ripple.scss_0_742 | @use 'sass:map';
@use '../../../style/sass-utils';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, ripple);
/// Generates custom tokens for the mat-ripple.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-ripple
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: (
color: sass-utils.safe-color-change(map.get($systems, md-sys-color, on-surface), $alpha: 0.1),
);
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 742,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_ripple.scss"
} |
components/src/material/core/tokens/m3/mat/_app.scss_0_1221 | @use 'sass:map';
@use 'sass:meta';
@use '../../../style/elevation';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, app);
/// Generates custom tokens for the app.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the app
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$shadow-color: map.get($systems, md-sys-color, shadow);
$tokens: (
background-color: map.get($systems, md-sys-color, background),
text-color: map.get($systems, md-sys-color, on-background),
);
// If the shadow-color is an actual color, convert it to a box-shadow value. Otherwise
// use the token value as itself (e,g. as a CSS var name).
@if (meta.type-of($shadow-color) == color) {
@for $zValue from 0 through 24 {
$shadow: elevation.get-box-shadow($zValue, $shadow-color);
$tokens: map.set($tokens, 'elevation-shadow-level-#{$zValue}', $shadow);
}
}
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 1221,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_app.scss"
} |
components/src/material/core/tokens/m3/mat/_minimal-pseudo-checkbox.scss_0_1294 | @use 'sass:map';
@use '../../../style/sass-utils';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, minimal-pseudo-checkbox);
/// Generates custom tokens for the minimal variant of mat-pseudo-checkbox.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the minimal variant of mat-pseudo-checkbox
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: ((
selected-checkmark-color: map.get($systems, md-sys-color, primary),
disabled-selected-checkmark-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-surface), $alpha: 0.38),
), (
// Color variants:
primary: (), // Default, no overrides needed.
secondary: (
selected-checkmark-color: map.get($systems, md-sys-color, secondary),
),
tertiary: (
selected-checkmark-color: map.get($systems, md-sys-color, tertiary),
),
error: (
selected-checkmark-color: map.get($systems, md-sys-color, error),
)
));
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 1294,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_minimal-pseudo-checkbox.scss"
} |
components/src/material/core/tokens/m3/mat/_menu.scss_0_2447 | @use 'sass:map';
@use '../../../style/sass-utils';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, menu);
/// Generates custom tokens for the mat-menu.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-menu
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: sass-utils.merge-all(
token-definition.generate-typography-tokens($systems, item-label-text, label-large),
(
container-shape: map.get($systems, md-sys-shape, corner-extra-small),
divider-color: map.get($systems, md-sys-color, surface-variant),
divider-bottom-spacing: token-definition.hardcode(8px, $exclude-hardcoded),
divider-top-spacing: token-definition.hardcode(8px, $exclude-hardcoded),
item-label-text-color: map.get($systems, md-sys-color, on-surface),
item-icon-color: map.get($systems, md-sys-color, on-surface-variant),
item-icon-size: token-definition.hardcode(24px, $exclude-hardcoded),
item-hover-state-layer-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-surface),
$alpha: map.get($systems, md-sys-state, hover-state-layer-opacity)
),
item-focus-state-layer-color: sass-utils.safe-color-change(
map.get($systems, md-sys-color, on-surface),
$alpha: map.get($systems, md-sys-state, focus-state-layer-opacity)
),
item-spacing: token-definition.hardcode(12px, $exclude-hardcoded),
item-leading-spacing: token-definition.hardcode(12px, $exclude-hardcoded),
item-trailing-spacing: token-definition.hardcode(12px, $exclude-hardcoded),
item-with-icon-leading-spacing: token-definition.hardcode(12px, $exclude-hardcoded),
item-with-icon-trailing-spacing: token-definition.hardcode(12px, $exclude-hardcoded),
container-color: map.get($systems, md-sys-color, surface-container),
// Note that this uses a value, rather than a computed box-shadow, because we use
// the value at runtime to determine which shadow to set based on the menu's depth.
base-elevation-level: token-definition.hardcode(2, $exclude-hardcoded),
)
);
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 2447,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_menu.scss"
} |
components/src/material/core/tokens/m3/mat/_card.scss_0_913 | @use 'sass:map';
@use '../../../style/sass-utils';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, card);
/// Generates custom tokens for the mat-card.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-card
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: sass-utils.merge-all(
token-definition.generate-typography-tokens($systems, title-text, title-large),
token-definition.generate-typography-tokens($systems, subtitle-text, title-medium),
(
subtitle-text-color: map.get($systems, md-sys-color, on-surface)
)
);
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 913,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_card.scss"
} |
components/src/material/core/tokens/m3/mat/_snack-bar.scss_0_686 | @use 'sass:map';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, snack-bar);
/// Generates custom tokens for the mat-snack-bar.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-snack-bar
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: (
button-color: map.get($systems, md-sys-color, inverse-primary),
);
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 686,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_snack-bar.scss"
} |
components/src/material/core/tokens/m3/mat/_icon.scss_0_1061 | @use 'sass:map';
@use '../../token-definition';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, icon);
/// Generates custom tokens for the mat-icon.
/// @param {Map} $systems The MDC system tokens
/// @param {Boolean} $exclude-hardcoded Whether to exclude hardcoded token values
/// @param {Map} $token-slots Possible token slots
/// @return {Map} A set of custom tokens for the mat-icon
@function get-tokens($systems, $exclude-hardcoded, $token-slots) {
$tokens: ((
color: token-definition.hardcode(inherit, $exclude-hardcoded),
), (
// Color variants:
surface: (), // Default, no overrides needed.
primary: (
color: map.get($systems, md-sys-color, primary),
),
secondary: (
color: map.get($systems, md-sys-color, secondary),
),
tertiary: (
color: map.get($systems, md-sys-color, tertiary),
),
error: (
color: map.get($systems, md-sys-color, error),
)
));
@return token-definition.namespace-tokens($prefix, $tokens, $token-slots);
}
| {
"end_byte": 1061,
"start_byte": 0,
"url": "https://github.com/angular/components/blob/main/src/material/core/tokens/m3/mat/_icon.scss"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.