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

Commit 772a03e

Browse files
committed
fix(typography): Separate @material/feature-targeting, was causing Sass test to fail
1 parent bdfd526 commit 772a03e

File tree

1 file changed

+26
-25
lines changed

1 file changed

+26
-25
lines changed

packages/mdc-typography/_mixins.scss

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@
2323
@use "sass:list";
2424
@use "sass:map";
2525
@use "sass:string";
26-
@use "@material/feature-targeting" as feature-targeting;
27-
@use "@material/theme";
26+
@use "@material/feature-targeting/functions" as feature-targeting-functions;
27+
@use "@material/feature-targeting/mixins" as feature-targeting-mixins;
28+
@use "@material/theme/mixins" as theme-mixins;
2829
@use "./variables";
2930

30-
@mixin core-styles($query: feature-targeting.all()) {
31+
@mixin core-styles($query: feature-targeting-functions.all()) {
3132
.mdc-typography {
3233
@include base($query: $query);
3334
}
@@ -39,28 +40,28 @@
3940
}
4041
}
4142

42-
@mixin base($query: feature-targeting.all()) {
43-
$feat-typography: feature-targeting.create-target($query, typography);
43+
@mixin base($query: feature-targeting-functions.all()) {
44+
$feat-typography: feature-targeting-functions.create-target($query, typography);
4445

4546
@include smooth-font($query: $query);
46-
@include feature-targeting.targets($feat-typography) {
47-
@include theme.prop(font-family, (
47+
@include feature-targeting-mixins.targets($feat-typography) {
48+
@include theme-mixins.prop(font-family, (
4849
varname: --mdc-typography-font-family,
4950
fallback: map.get(variables.$base, 'font-family')
5051
));
5152
}
5253
}
5354

54-
@mixin typography($style, $query: feature-targeting.all(), $exclude-props: ()) {
55-
$feat-typography: feature-targeting.create-target($query, typography);
55+
@mixin typography($style, $query: feature-targeting-functions.all(), $exclude-props: ()) {
56+
$feat-typography: feature-targeting-functions.create-target($query, typography);
5657
$style-props: map.get(variables.$styles, $style);
5758

5859
@if not map.has-key(variables.$styles, $style) {
5960
@error "Invalid style specified! #{$style} doesn't exist. Choose one of #{map.keys(variables.$styles)}";
6061
}
6162

6263
@include smooth-font($query: $query);
63-
@include feature-targeting.targets($feat-typography) {
64+
@include feature-targeting-mixins.targets($feat-typography) {
6465
@each $key, $value in $style-props {
6566
@if list.index($exclude-props, $key) == null {
6667
$fallback: $value;
@@ -74,7 +75,7 @@
7475
);
7576
}
7677

77-
@include theme.prop($key, (
78+
@include theme-mixins.prop($key, (
7879
varname: --mdc-typography-#{$style}-#{$key},
7980
fallback: $fallback
8081
));
@@ -84,54 +85,54 @@
8485
}
8586

8687
/// Applies antialiasing via font-smoothing to text.
87-
@mixin smooth-font($query: feature-targeting.all()) {
88-
$feat-typography: feature-targeting.create-target($query, typography);
88+
@mixin smooth-font($query: feature-targeting-functions.all()) {
89+
$feat-typography: feature-targeting-functions.create-target($query, typography);
8990

90-
@include feature-targeting.targets($feat-typography) {
91+
@include feature-targeting-mixins.targets($feat-typography) {
9192
-moz-osx-font-smoothing: grayscale;
9293
-webkit-font-smoothing: antialiased;
9394
}
9495
}
9596

9697
// Element must be `display: block` or `display: inline-block` for this to work.
97-
@mixin overflow-ellipsis($query: feature-targeting.all()) {
98-
$feat-structure: feature-targeting.create-target($query, structure);
98+
@mixin overflow-ellipsis($query: feature-targeting-functions.all()) {
99+
$feat-structure: feature-targeting-functions.create-target($query, structure);
99100

100-
@include feature-targeting.targets($feat-structure) {
101+
@include feature-targeting-mixins.targets($feat-structure) {
101102
text-overflow: ellipsis;
102103
white-space: nowrap;
103104
overflow: hidden;
104105
}
105106
}
106107

107-
@mixin baseline-top($distance, $query: feature-targeting.all()) {
108-
$feat-structure: feature-targeting.create-target($query, structure);
108+
@mixin baseline-top($distance, $query: feature-targeting-functions.all()) {
109+
$feat-structure: feature-targeting-functions.create-target($query, structure);
109110

110-
@include feature-targeting.targets($feat-structure) {
111+
@include feature-targeting-mixins.targets($feat-structure) {
111112
display: block;
112113
margin-top: 0;
113114
/* @alternate */
114115
line-height: normal;
115116
}
116117

117118
&::before {
118-
@include feature-targeting.targets($feat-structure) {
119+
@include feature-targeting-mixins.targets($feat-structure) {
119120
@include baseline-strut_($distance);
120121

121122
vertical-align: 0;
122123
}
123124
}
124125
}
125126

126-
@mixin baseline-bottom($distance, $query: feature-targeting.all()) {
127-
$feat-structure: feature-targeting.create-target($query, structure);
127+
@mixin baseline-bottom($distance, $query: feature-targeting-functions.all()) {
128+
$feat-structure: feature-targeting-functions.create-target($query, structure);
128129

129-
@include feature-targeting.targets($feat-structure) {
130+
@include feature-targeting-mixins.targets($feat-structure) {
130131
margin-bottom: -1 * $distance;
131132
}
132133

133134
&::after {
134-
@include feature-targeting.targets($feat-structure) {
135+
@include feature-targeting-mixins.targets($feat-structure) {
135136
@include baseline-strut_($distance);
136137

137138
vertical-align: -1 * $distance;

0 commit comments

Comments
 (0)