Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit 6683a36

Browse files
sayriscopybara-github
authored andcommitted
style(card): Card theme-styles mixin creates css variables.
Also updates relevant card mixins to use `theme.property` wherever a value from the theme map is used. (Omitting this results in css compilation errors). PiperOrigin-RevId: 465115942
1 parent e457014 commit 6683a36

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

packages/mdc-card/_elevated-card-theme.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ $light-theme: (
6363

6464
@mixin theme-styles($theme, $resolver: resolvers.$material) {
6565
@include theme.validate-theme-keys($light-theme, $theme);
66+
$theme: keys.create-theme-properties(
67+
$theme,
68+
$prefix: $custom-property-prefix
69+
);
6670

6771
@include card-shared-theme.theme($theme, $resolver);
6872
@include card.outline(

packages/mdc-card/_filled-card-theme.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ $light-theme: (
6363

6464
@mixin theme-styles($theme, $resolver: resolvers.$material) {
6565
@include theme.validate-theme-keys($light-theme, $theme);
66+
$theme: keys.create-theme-properties(
67+
$theme,
68+
$prefix: $custom-property-prefix
69+
);
6670

6771
@include card-shared-theme.theme($theme, $resolver);
6872
@include card.outline(

packages/mdc-card/_mixins.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,12 +381,12 @@ $ripple-target: '.mdc-card__ripple';
381381
$feat-structure: feature-targeting.create-target($query, structure);
382382

383383
@include feature-targeting.targets($feat-structure) {
384-
border-width: $thickness;
384+
@include theme.property(border-width, $thickness);
385385
border-style: solid;
386386
}
387387

388388
@include feature-targeting.targets($feat-color) {
389-
border-color: theme-color.prop-value($color);
389+
@include theme.property(border-color, $color);
390390
}
391391
}
392392

packages/mdc-card/_outlined-card-theme.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ $light-theme: (
7272

7373
@mixin theme-styles($theme, $resolver: resolvers.$material) {
7474
@include theme.validate-theme-keys($light-theme, $theme);
75-
75+
$theme: keys.create-theme-properties(
76+
$theme,
77+
$prefix: $custom-property-prefix
78+
);
7679
@include _outline(
7780
$outline-width: map.get($theme, outline-width),
7881
$map: (

0 commit comments

Comments
 (0)