@@ -146,11 +146,14 @@ These styles can be used as the `$style` argument for the `mdc-typography` mixin
146146
147147#### Overriding Styles
148148
149- All styles can be overridden using CSS custom properties or Sass global variables.
149+ All styles can be overridden using CSS custom properties or Sass module/ global variables.
150150
151- When using Sass global variables, they must be defined _ before_ the component is imported by setting a global
152- variable named ` $mdc-typography-styles-{style} ` . The variable should be assigned a map that contains all the properties
153- you want to override for a particular style.
151+ When using Sass ** module** variables, the module must be configured _ before_ any other ` @use `
152+ statements with a variable named ` $styles-{style} ` . The variable should be assigned to a map
153+ that contains all the properties you want to override for a particular style.
154+
155+ When using Sass ** global** variables, they must be defined _ before_ the component is imported by setting a global
156+ variable named ` $mdc-typography-styles-{style} ` .
154157
155158** Example:** Overriding the button ` font-size ` and ` text-transform ` properties.
156159
@@ -163,6 +166,20 @@ html {
163166}
164167```
165168
169+ Sass module variables:
170+
171+ ``` scss
172+ @use " @material/typography" with (
173+ $styles-button : (
174+ font-size : 16px ,
175+ text-transform : none ,
176+ )
177+ );
178+
179+ @use " @material/button" ;
180+ @include button .core-styles ;
181+ ```
182+
166183Sass global variables:
167184
168185``` scss
@@ -171,7 +188,7 @@ $mdc-typography-styles-button: (
171188 text-transform : none ,
172189);
173190
174- @use " @material/button/mdc-button" ;
191+ @import " @material/button/mdc-button" ;
175192```
176193
177194** Example:** Overriding the global ` font-family ` property.
@@ -184,13 +201,23 @@ html {
184201}
185202```
186203
204+ Sass module variables:
205+
206+ ``` scss
207+ @use " @material/typography" with (
208+ $font-family : unquote (" Arial, Helvetica, sans-serif" )
209+ );
210+
211+ @use " @material/button" ;
212+ @include button .core-styles ;
213+ ```
214+
187215Sass global variables:
188216
189217``` scss
190218$mdc-typography-font-family : unquote (" Arial, Helvetica, sans-serif" );
191219
192- ...
193- @use ...
220+ @import " @material/button/mdc-button" ;
194221```
195222
196223** Example:** Overriding the ` font-family ` property for ` headline1 ` and ` font-family ` and ` font-size ` for ` headline2 ` .
@@ -205,6 +232,22 @@ html {
205232}
206233```
207234
235+ Sass module variables:
236+
237+ ``` scss
238+ @use " @material/typography" with (
239+ $styles-headline1 : (
240+ $font-family : unquote (" Arial, Helvetica, sans-serif" )
241+ ),
242+ $styles-headline2 : (
243+ $font-family : unquote (" Arial, Helvetica, sans-serif" ),
244+ $font-size : 3.25rem
245+ )
246+ );
247+
248+ @use ...
249+ ```
250+
208251Sass global variables :
209252
210253```scss
@@ -216,6 +259,5 @@ $mdc-typography-styles-headline2: (
216259 font-size : 3.25rem
217260);
218261
219- ...
220- @use ...
262+ @import ...
221263```
0 commit comments