|
23 | 23 | @use "sass:list"; |
24 | 24 | @use "sass:map"; |
25 | 25 | @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; |
28 | 29 | @use "./variables"; |
29 | 30 |
|
30 | | -@mixin core-styles($query: feature-targeting.all()) { |
| 31 | +@mixin core-styles($query: feature-targeting-functions.all()) { |
31 | 32 | .mdc-typography { |
32 | 33 | @include base($query: $query); |
33 | 34 | } |
|
39 | 40 | } |
40 | 41 | } |
41 | 42 |
|
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); |
44 | 45 |
|
45 | 46 | @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, ( |
48 | 49 | varname: --mdc-typography-font-family, |
49 | 50 | fallback: map.get(variables.$base, 'font-family') |
50 | 51 | )); |
51 | 52 | } |
52 | 53 | } |
53 | 54 |
|
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); |
56 | 57 | $style-props: map.get(variables.$styles, $style); |
57 | 58 |
|
58 | 59 | @if not map.has-key(variables.$styles, $style) { |
59 | 60 | @error "Invalid style specified! #{$style} doesn't exist. Choose one of #{map.keys(variables.$styles)}"; |
60 | 61 | } |
61 | 62 |
|
62 | 63 | @include smooth-font($query: $query); |
63 | | - @include feature-targeting.targets($feat-typography) { |
| 64 | + @include feature-targeting-mixins.targets($feat-typography) { |
64 | 65 | @each $key, $value in $style-props { |
65 | 66 | @if list.index($exclude-props, $key) == null { |
66 | 67 | $fallback: $value; |
|
74 | 75 | ); |
75 | 76 | } |
76 | 77 |
|
77 | | - @include theme.prop($key, ( |
| 78 | + @include theme-mixins.prop($key, ( |
78 | 79 | varname: --mdc-typography-#{$style}-#{$key}, |
79 | 80 | fallback: $fallback |
80 | 81 | )); |
|
84 | 85 | } |
85 | 86 |
|
86 | 87 | /// 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); |
89 | 90 |
|
90 | | - @include feature-targeting.targets($feat-typography) { |
| 91 | + @include feature-targeting-mixins.targets($feat-typography) { |
91 | 92 | -moz-osx-font-smoothing: grayscale; |
92 | 93 | -webkit-font-smoothing: antialiased; |
93 | 94 | } |
94 | 95 | } |
95 | 96 |
|
96 | 97 | // 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); |
99 | 100 |
|
100 | | - @include feature-targeting.targets($feat-structure) { |
| 101 | + @include feature-targeting-mixins.targets($feat-structure) { |
101 | 102 | text-overflow: ellipsis; |
102 | 103 | white-space: nowrap; |
103 | 104 | overflow: hidden; |
104 | 105 | } |
105 | 106 | } |
106 | 107 |
|
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); |
109 | 110 |
|
110 | | - @include feature-targeting.targets($feat-structure) { |
| 111 | + @include feature-targeting-mixins.targets($feat-structure) { |
111 | 112 | display: block; |
112 | 113 | margin-top: 0; |
113 | 114 | /* @alternate */ |
114 | 115 | line-height: normal; |
115 | 116 | } |
116 | 117 |
|
117 | 118 | &::before { |
118 | | - @include feature-targeting.targets($feat-structure) { |
| 119 | + @include feature-targeting-mixins.targets($feat-structure) { |
119 | 120 | @include baseline-strut_($distance); |
120 | 121 |
|
121 | 122 | vertical-align: 0; |
122 | 123 | } |
123 | 124 | } |
124 | 125 | } |
125 | 126 |
|
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); |
128 | 129 |
|
129 | | - @include feature-targeting.targets($feat-structure) { |
| 130 | + @include feature-targeting-mixins.targets($feat-structure) { |
130 | 131 | margin-bottom: -1 * $distance; |
131 | 132 | } |
132 | 133 |
|
133 | 134 | &::after { |
134 | | - @include feature-targeting.targets($feat-structure) { |
| 135 | + @include feature-targeting-mixins.targets($feat-structure) { |
135 | 136 | @include baseline-strut_($distance); |
136 | 137 |
|
137 | 138 | vertical-align: -1 * $distance; |
|
0 commit comments