|
| 1 | +@use '../theming/typography'; |
| 2 | + |
1 | 3 | // Utility classes that can be used to style elements with the most commonly used system tokens in |
2 | 4 | // Material Design. Includes color, typography, elevation, state, and shape. |
3 | 5 | @mixin system-classes() { |
|
195 | 197 | // Sets the font to the body small typeface. Use for small body text, such as captions. In Angular |
196 | 198 | // Material, this is used for the subscript text in a form field and the text in a paginator. |
197 | 199 | .mat-font-body-sm { |
198 | | - font: var(--mat-sys-body-small); |
199 | | - letter-spacing: var(--mat-sys-body-small-tracking); |
| 200 | + @include typography.body-small(); |
200 | 201 | } |
201 | 202 |
|
202 | 203 | // Sets the font to the body medium typeface. Use for medium body text, this is the default |
203 | 204 | // body font. In Angular Material, this is used for the text in a table row and the supporting |
204 | 205 | // text in a dialog. |
205 | 206 | .mat-font-body-md { |
206 | | - font: var(--mat-sys-body-medium); |
207 | | - letter-spacing: var(--mat-sys-body-medium-tracking); |
| 207 | + @include typography.body-medium(); |
208 | 208 | } |
209 | 209 |
|
210 | 210 | // Sets the font to the body large typeface. Use for large body text, such as an introductory |
211 | 211 | // paragraph. In Angular Material, this is used for the text in a list item and the text in a |
212 | 212 | // select trigger. |
213 | 213 | .mat-font-body-lg { |
214 | | - font: var(--mat-sys-body-large); |
215 | | - letter-spacing: var(--mat-sys-body-large-tracking); |
| 214 | + @include typography.body-large(); |
216 | 215 | } |
217 | 216 |
|
218 | 217 | // Sets the font to the display small typeface. Use for small display text, such as a date. |
219 | 218 | .mat-font-display-sm { |
220 | | - font: var(--mat-sys-display-small); |
221 | | - letter-spacing: var(--mat-sys-display-small-tracking); |
| 219 | + @include typography.display-small(); |
222 | 220 | } |
223 | 221 |
|
224 | 222 | // Sets the font to the display medium typeface. Use for medium display text, such as a hero |
225 | 223 | // title. |
226 | 224 | .mat-font-display-md { |
227 | | - font: var(--mat-sys-display-medium); |
228 | | - letter-spacing: var(--mat-sys-display-medium-tracking); |
| 225 | + @include typography.display-medium(); |
229 | 226 | } |
230 | 227 |
|
231 | 228 | // Sets the font to the display large typeface. Use for large display text, such as a hero title. |
232 | 229 | .mat-font-display-lg { |
233 | | - font: var(--mat-sys-display-large); |
234 | | - letter-spacing: var(--mat-sys-display-large-tracking); |
| 230 | + @include typography.display-large(); |
235 | 231 | } |
236 | 232 |
|
237 | 233 | // Sets the font to the headline small typeface. Use for small headlines, such as a page title. In |
238 | 234 | // Angular Material, this is used for the headline in a dialog. |
239 | 235 | .mat-font-headline-sm { |
240 | | - font: var(--mat-sys-headline-small); |
241 | | - letter-spacing: var(--mat-sys-headline-small-tracking); |
| 236 | + @include typography.headline-small(); |
242 | 237 | } |
243 | 238 |
|
244 | 239 | // Sets the font to the headline medium typeface. Use for medium headlines, such as a section |
245 | 240 | // title. |
246 | 241 | .mat-font-headline-md { |
247 | | - font: var(--mat-sys-headline-medium); |
248 | | - letter-spacing: var(--mat-sys-headline-medium-tracking); |
| 242 | + @include typography.headline-medium(); |
249 | 243 | } |
250 | 244 |
|
251 | 245 | // Sets the font to the headline large typeface. Use for large headlines, such as a page title on |
252 | 246 | // a large screen. |
253 | 247 | .mat-font-headline-lg { |
254 | | - font: var(--mat-sys-headline-large); |
255 | | - letter-spacing: var(--mat-sys-headline-large-tracking); |
| 248 | + @include typography.headline-large(); |
256 | 249 | } |
257 | 250 |
|
258 | 251 | // Sets the font to the label small typeface. Use for small labels, such as text in a badge. |
259 | 252 | .mat-font-label-sm { |
260 | | - font: var(--mat-sys-label-small); |
261 | | - letter-spacing: var(--mat-sys-label-small-tracking); |
| 253 | + @include typography.label-small(); |
262 | 254 | } |
263 | 255 |
|
264 | 256 | // Sets the font to the label medium typeface. Use for medium labels. In Angular Material, this |
265 | 257 | // is used for the slider label. |
266 | 258 | .mat-font-label-md { |
267 | | - font: var(--mat-sys-label-medium); |
268 | | - letter-spacing: var(--mat-sys-label-medium-tracking); |
| 259 | + @include typography.label-medium(); |
269 | 260 | } |
270 | 261 |
|
271 | 262 | // Sets the font to the label large typeface. Use for large labels. In Angular Material, this is |
272 | 263 | // used for buttons, chips, and menu labels. |
273 | 264 | .mat-font-label-lg { |
274 | | - font: var(--mat-sys-label-large); |
275 | | - letter-spacing: var(--mat-sys-label-large-tracking); |
| 265 | + @include typography.label-large(); |
276 | 266 | } |
277 | 267 |
|
278 | 268 | // Sets the font to the title small typeface. Use for small titles, such as a card title. In |
279 | 269 | // Angular Material, this is used for the header of a table and the label of an option group. |
280 | 270 | .mat-font-title-sm { |
281 | | - font: var(--mat-sys-title-small); |
282 | | - letter-spacing: var(--mat-sys-title-small-tracking); |
| 271 | + @include typography.title-small(); |
283 | 272 | } |
284 | 273 |
|
285 | 274 | // Sets the font to the title medium typeface. Use for medium titles, such as a dialog title |
286 | 275 | // or the primary text in a list item. In Angular Material, this is used for the subtitle |
287 | 276 | // of a card and the header of an expansion panel. |
288 | 277 | .mat-font-title-md { |
289 | | - font: var(--mat-sys-title-medium); |
290 | | - letter-spacing: var(--mat-sys-title-medium-tracking); |
| 278 | + @include typography.title-medium(); |
291 | 279 | } |
292 | 280 |
|
293 | 281 | // Sets the font to the title large typeface. Use for large titles, such as a page title on a |
294 | 282 | // small screen. In Angular Material, this is used for the title of a card and the title of a |
295 | 283 | // toolbar. |
296 | 284 | .mat-font-title-lg { |
297 | | - font: var(--mat-sys-title-large); |
298 | | - letter-spacing: var(--mat-sys-title-large-tracking); |
| 285 | + @include typography.title-large(); |
299 | 286 | } |
300 | 287 |
|
301 | 288 |
|
|
0 commit comments