|
1 | 1 | // Utility classes that can be used to style elements with the most commonly used system tokens in
|
2 |
| -// Material Design. Includes color, typography, elevation, and shape. |
| 2 | +// Material Design. Includes color, typography, elevation, state, and shape. |
3 | 3 | @mixin system-classes() {
|
4 | 4 |
|
5 | 5 | // ***********************************************************************************************
|
6 |
| - // Background |
| 6 | + // Background - Apply background color and a contrastful corresponding text color |
| 7 | + // See https://m3.material.io/styles/color/roles for guidance. |
7 | 8 | // ***********************************************************************************************
|
8 | 9 |
|
9 | 10 | // Styles an element with a primary color background and applies an accessible contrasting
|
|
135 | 136 |
|
136 | 137 |
|
137 | 138 | // ***********************************************************************************************
|
138 |
| - // Text |
| 139 | + // Text - Apply colors to text |
139 | 140 | // ***********************************************************************************************
|
140 | 141 |
|
141 | 142 | // Styles the text of an element with the primary color. Use for text that needs to stand out.
|
|
164 | 165 |
|
165 | 166 |
|
166 | 167 | // ***********************************************************************************************
|
167 |
| - // Font |
| 168 | + // Font - Apply typography styles |
| 169 | + // See https://m3.material.io/styles/typography/applying-type for guidance. |
168 | 170 | // ***********************************************************************************************
|
169 | 171 |
|
170 | 172 | // Sets the font to the body small typeface. Use for small body text, such as captions. In Angular
|
|
255 | 257 |
|
256 | 258 |
|
257 | 259 | // ***********************************************************************************************
|
258 |
| - // Corner |
| 260 | + // Corner - Apply varying amounts of a border radius |
| 261 | + // See https://m3.material.io/styles/shape/corner-radius-scale for guidance. |
259 | 262 | // ***********************************************************************************************
|
260 | 263 |
|
261 | 264 | // Sets the border radius to extra small. Use for components that need a small amount of rounding,
|
262 | 265 | // such as a chip. In Angular Material, this is used for the shape of a snackbar and a tooltip.
|
263 |
| - .mat-rounded-extra-sm { |
| 266 | + .mat-corner-extra-sm { |
264 | 267 | border-radius: var(--mat-sys-corner-extra-small);
|
265 | 268 | }
|
266 | 269 |
|
267 | 270 | // Sets the border radius to small. Use for components that need a small amount of rounding, such
|
268 | 271 | // as a text field.
|
269 |
| - .mat-rounded-sm { |
| 272 | + .mat-corner-sm { |
270 | 273 | border-radius: var(--mat-sys-corner-small);
|
271 | 274 | }
|
272 | 275 |
|
273 | 276 | // Sets the border radius to medium. Use for components that need a medium amount of rounding,
|
274 | 277 | // such as a button. In Angular Material, this is used for the shape of a card.
|
275 |
| - .mat-rounded-md { |
| 278 | + .mat-corner-md { |
276 | 279 | border-radius: var(--mat-sys-corner-medium);
|
277 | 280 | }
|
278 | 281 |
|
279 | 282 | // Sets the border radius to large. Use for components that need a large amount of rounding, such
|
280 | 283 | // as a card. In Angular Material, this is used for the shape of a floating action button and a
|
281 | 284 | // datepicker.
|
282 |
| - .mat-rounded-lg { |
| 285 | + .mat-corner-lg { |
283 | 286 | border-radius: var(--mat-sys-corner-large);
|
284 | 287 | }
|
285 | 288 |
|
286 | 289 | // Sets the border radius to extra large. Use for components that need a large amount of
|
287 | 290 | // rounding. In Angular Material, this is used for the shape of a button toggle and the shape of
|
288 | 291 | // a dialog.
|
289 |
| - .mat-rounded-xl { |
| 292 | + .mat-corner-xl { |
290 | 293 | border-radius: var(--mat-sys-corner-extra-large);
|
291 | 294 | }
|
292 | 295 |
|
293 | 296 | // Sets the border radius to full. Use for components that are circular, such as a user avatar.
|
294 | 297 | // In Angular Material, this is used for the shape of a badge and the shape of a button.
|
295 |
| - .mat-rounded-full { |
| 298 | + .mat-corner-full { |
296 | 299 | border-radius: var(--mat-sys-corner-full);
|
297 | 300 | }
|
298 | 301 |
|
299 | 302 |
|
300 | 303 | // ***********************************************************************************************
|
301 |
| - // Border |
| 304 | + // Border - Applies a 1px solid border |
302 | 305 | // ***********************************************************************************************
|
303 | 306 |
|
304 | 307 | // Adds an outline to an element. Use for components that need a visible boundary. In Angular
|
|
316 | 319 |
|
317 | 320 |
|
318 | 321 | // ***********************************************************************************************
|
319 |
| - // State |
| 322 | + // Interactive - Adds interaction colors for hover, active, and focus |
320 | 323 | // ***********************************************************************************************
|
321 | 324 |
|
322 | 325 | // Adds hover, focus, and active states to an element by applying varying shades of the surface
|
323 | 326 | // color. Use for interactive components that are not based on a primary color.
|
324 |
| - .mat-stateful { |
| 327 | + .mat-interactive { |
325 | 328 | &:hover {
|
326 | 329 | background: color-mix(
|
327 | 330 | in srgb,
|
|
349 | 352 |
|
350 | 353 | // Adds hover, focus, and active states to an element by applying varying shades of the primary
|
351 | 354 | // color. Use for interactive components that are not based on a primary color.
|
352 |
| - .mat-stateful-primary { |
| 355 | + .mat-interactive-primary { |
353 | 356 | &:hover {
|
354 | 357 | background: color-mix(
|
355 | 358 | in srgb,
|
|
377 | 380 |
|
378 | 381 |
|
379 | 382 | // ***********************************************************************************************
|
380 |
| - // Elevation |
| 383 | + // Shadow - Applies elevation levels through box-shadow |
| 384 | + // See https://m3.material.io/styles/elevation/applying-elevation for guidance. |
381 | 385 | // ***********************************************************************************************
|
382 | 386 |
|
383 | 387 | // Use to slightly raise the appearance of a surface. In Angular Material, this is used for the
|
|
0 commit comments