Skip to content

Commit 8308ada

Browse files
authored
docs: add expanding detail with all variables (angular#32352)
1 parent b743840 commit 8308ada

File tree

2 files changed

+256
-5
lines changed

2 files changed

+256
-5
lines changed

docs/src/styles/_markdown.scss

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
}
3535

3636
// stylelint-disable-next-line selector-class-pattern
37-
h3 .material-icons, h4 .material-icons {
37+
h3 .material-icons,
38+
h4 .material-icons {
3839
color: var(--mat-sys-on-surface);
3940
}
4041

@@ -44,7 +45,9 @@
4445
font-weight: 400;
4546
}
4647

47-
p, ul, ol {
48+
p,
49+
ul,
50+
ol {
4851
font-size: 16px;
4952
line-height: 28px;
5053
}
@@ -118,4 +121,30 @@
118121
}
119122
}
120123

124+
summary {
125+
cursor: pointer;
126+
padding: 8px;
127+
128+
&:hover {
129+
background-color: color-mix(
130+
in srgb,
131+
var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%),
132+
transparent
133+
);
134+
}
135+
&:focus {
136+
background-color: color-mix(
137+
in srgb,
138+
var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%),
139+
transparent
140+
);
141+
}
142+
&:active {
143+
background-color: color-mix(
144+
in srgb,
145+
var(--mat-sys-on-surface) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%),
146+
transparent
147+
);
148+
}
149+
}
121150
}

guides/theming-your-components.md

Lines changed: 225 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,75 @@ Using the system tokens makes it easy to match the same color scheme of your app
3838
also makes it easy to ensure your application can correctly handle both light and dark mode
3939
automatically.
4040

41+
<details>
42+
<summary>Expand to view all available color system tokens</summary>
43+
44+
```css
45+
/* Primary */
46+
--mat-sys-primary
47+
--mat-sys-on-primary
48+
--mat-sys-primary-container
49+
--mat-sys-on-primary-container
50+
--mat-sys-primary-fixed
51+
--mat-sys-on-primary-fixed
52+
--mat-sys-on-primary-fixed-variant
53+
--mat-sys-primary-fixed-dim
54+
--mat-sys-inverse-primary
55+
56+
/* Secondary */
57+
--mat-sys-secondary
58+
--mat-sys-on-secondary
59+
--mat-sys-secondary-container
60+
--mat-sys-on-secondary-container
61+
--mat-sys-secondary-fixed
62+
--mat-sys-on-secondary-fixed
63+
--mat-sys-on-secondary-fixed-variant
64+
--mat-sys-secondary-fixed-dim
65+
66+
/* Tertiary */
67+
--mat-sys-tertiary
68+
--mat-sys-on-tertiary
69+
--mat-sys-tertiary-container
70+
--mat-sys-on-tertiary-container
71+
--mat-sys-tertiary-fixed
72+
--mat-sys-on-tertiary-fixed
73+
--mat-sys-on-tertiary-fixed-variant
74+
--mat-sys-tertiary-fixed-dim
75+
76+
/* Error */
77+
--mat-sys-error
78+
--mat-sys-on-error
79+
--mat-sys-error-container
80+
--mat-sys-on-error-container
81+
82+
/* Surface */
83+
--mat-sys-surface
84+
--mat-sys-on-surface
85+
--mat-sys-on-surface-variant
86+
--mat-sys-surface-bright
87+
--mat-sys-surface-container
88+
--mat-sys-surface-container-high
89+
--mat-sys-surface-container-highest
90+
--mat-sys-surface-container-low
91+
--mat-sys-surface-container-lowest
92+
--mat-sys-surface-dim
93+
--mat-sys-surface-tint
94+
--mat-sys-surface-variant
95+
--mat-sys-inverse-surface
96+
--mat-sys-inverse-on-surface
97+
98+
/* Miscellaneous */
99+
--mat-sys-background
100+
--mat-sys-on-background
101+
--mat-sys-neutral-variant20
102+
--mat-sys-neutral10
103+
--mat-sys-outline
104+
--mat-sys-outline-variant
105+
--mat-sys-scrim
106+
--mat-sys-shadow
107+
```
108+
</details>
109+
41110
### Background
42111

43112
<h4>Primary</h4>
@@ -383,6 +452,119 @@ Each category has three sizes: small, medium, and large. Learn more about how th
383452
their sizes should be used in your application by visiting Material
384453
Design's [Applying Type](https://m3.material.io/styles/typography/applying-type) documentation.
385454

455+
<details>
456+
<summary>Expand to view all available typography system tokens</summary>
457+
458+
```css
459+
--mat-sys-body-large
460+
--mat-sys-body-large-font
461+
--mat-sys-body-large-line-height
462+
--mat-sys-body-large-size
463+
--mat-sys-body-large-tracking
464+
--mat-sys-body-large-weight
465+
466+
--mat-sys-body-medium
467+
--mat-sys-body-medium-font
468+
--mat-sys-body-medium-line-height
469+
--mat-sys-body-medium-size
470+
--mat-sys-body-medium-tracking
471+
--mat-sys-body-medium-weight
472+
473+
--mat-sys-body-small
474+
--mat-sys-body-small-font
475+
--mat-sys-body-small-line-height
476+
--mat-sys-body-small-size
477+
--mat-sys-body-small-tracking
478+
--mat-sys-body-small-weight
479+
480+
--mat-sys-display-large
481+
--mat-sys-display-large-font
482+
--mat-sys-display-large-line-height
483+
--mat-sys-display-large-size
484+
--mat-sys-display-large-tracking
485+
--mat-sys-display-large-weight
486+
487+
--mat-sys-display-medium
488+
--mat-sys-display-medium-font
489+
--mat-sys-display-medium-line-height
490+
--mat-sys-display-medium-size
491+
--mat-sys-display-medium-tracking
492+
--mat-sys-display-medium-weight
493+
494+
--mat-sys-display-small
495+
--mat-sys-display-small-font
496+
--mat-sys-display-small-line-height
497+
--mat-sys-display-small-size
498+
--mat-sys-display-small-tracking
499+
--mat-sys-display-small-weight
500+
501+
--mat-sys-headline-large
502+
--mat-sys-headline-large-font
503+
--mat-sys-headline-large-line-height
504+
--mat-sys-headline-large-size
505+
--mat-sys-headline-large-tracking
506+
--mat-sys-headline-large-weight
507+
508+
--mat-sys-headline-medium
509+
--mat-sys-headline-medium-font
510+
--mat-sys-headline-medium-line-height
511+
--mat-sys-headline-medium-size
512+
--mat-sys-headline-medium-tracking
513+
--mat-sys-headline-medium-weight
514+
515+
--mat-sys-headline-small
516+
--mat-sys-headline-small-font
517+
--mat-sys-headline-small-line-height
518+
--mat-sys-headline-small-size
519+
--mat-sys-headline-small-tracking
520+
--mat-sys-headline-small-weight
521+
522+
--mat-sys-label-large
523+
--mat-sys-label-large-font
524+
--mat-sys-label-large-line-height
525+
--mat-sys-label-large-size
526+
--mat-sys-label-large-tracking
527+
--mat-sys-label-large-weight
528+
--mat-sys-label-large-weight-prominent
529+
530+
--mat-sys-label-medium
531+
--mat-sys-label-medium-font
532+
--mat-sys-label-medium-line-height
533+
--mat-sys-label-medium-size
534+
--mat-sys-label-medium-tracking
535+
--mat-sys-label-medium-weight
536+
--mat-sys-label-medium-weight-prominent
537+
538+
--mat-sys-label-small
539+
--mat-sys-label-small-font
540+
--mat-sys-label-small-line-height
541+
--mat-sys-label-small-size
542+
--mat-sys-label-small-tracking
543+
--mat-sys-label-small-weight
544+
545+
--mat-sys-title-large
546+
--mat-sys-title-large-font
547+
--mat-sys-title-large-line-height
548+
--mat-sys-title-large-size
549+
--mat-sys-title-large-tracking
550+
--mat-sys-title-large-weight
551+
552+
--mat-sys-title-medium
553+
--mat-sys-title-medium-font
554+
--mat-sys-title-medium-line-height
555+
--mat-sys-title-medium-size
556+
--mat-sys-title-medium-tracking
557+
--mat-sys-title-medium-weight
558+
559+
--mat-sys-title-small
560+
--mat-sys-title-small-font
561+
--mat-sys-title-small-line-height
562+
--mat-sys-title-small-size
563+
--mat-sys-title-small-tracking
564+
--mat-sys-title-small-weight
565+
```
566+
</details>
567+
386568
<h3> Body </h3>
387569

388570

@@ -581,9 +763,28 @@ Design's [Corner Radius Scale](https://m3.material.io/styles/shape/corner-radius
581763
documentation to learn more.
582764

583765
In Angular Material, shape is scoped to varying levels of border-radius. The following code blocks
584-
demonstate the levels of roundness. Their border sizes are increased to 2px to clearly show the
766+
demonstrate the levels of roundness. Their border sizes are increased to `2px` to clearly show the
585767
border radii.
586768

769+
<details>
770+
<summary>Expand to view all available corner shape system tokens</summary>
771+
772+
```css
773+
--mat-sys-corner-extra-large: 28px;
774+
--mat-sys-corner-extra-large-top: 28px 28px 0 0;
775+
--mat-sys-corner-extra-small: 4px;
776+
--mat-sys-corner-extra-small-top: 4px 4px 0 0;
777+
--mat-sys-corner-full: 9999px;
778+
--mat-sys-corner-large: 16px;
779+
--mat-sys-corner-large-end: 0 16px 16px 0;
780+
--mat-sys-corner-large-start: 16px 0 0 16px;
781+
--mat-sys-corner-large-top: 16px 16px 0 0;
782+
--mat-sys-corner-medium: 12px;
783+
--mat-sys-corner-none: 0;
784+
--mat-sys-corner-small: 8px;
785+
```
786+
</details>
787+
587788
The extra small border radius is useful for components that need a small amount of rounding, such as
588789
a chip. In Angular Material, this is used for the shape of a snackbar and a tooltip.
589790

@@ -637,11 +838,19 @@ Material, this is used for the shape of a badge and the shape of a button.
637838

638839
Material Design uses borders and shadows to create a sense of depth and hierarchy in the UI. See
639840
Material Design's [Applying Elevation](https://m3.material.io/styles/elevation/applying-elevation)
640-
documentation to
641-
learn more.
841+
documentation to learn more.
642842

643843
<h3> Border </h3>
644844

845+
<details>
846+
<summary>Expand to view the outline system tokens</summary>
847+
848+
```css
849+
--mat-sys-outline
850+
--mat-sys-outline-variant
851+
```
852+
</details>
853+
645854
The Material Design border is useful for components that need a visible boundary. In Angular
646855
Material, this is used for the outline of an outlined button.
647856

@@ -662,6 +871,19 @@ Material, this is used for the outline of an outlined card and the color of the
662871

663872
<h3> Shadow </h3>
664873

874+
<details>
875+
<summary>Expand to view all available elevation system tokens</summary>
876+
877+
```css
878+
--mat-sys-level0: 0px 0px 0px 0px rgba(0, 0, 0, .2), 0px 0px 0px 0px rgba(0, 0, 0, .14), 0px 0px 0px 0px rgba(0, 0, 0, .12);
879+
--mat-sys-level1: 0px 2px 1px -1px rgba(0, 0, 0, .2), 0px 1px 1px 0px rgba(0, 0, 0, .14), 0px 1px 3px 0px rgba(0, 0, 0, .12);
880+
--mat-sys-level2: 0px 3px 3px -2px rgba(0, 0, 0, .2), 0px 3px 4px 0px rgba(0, 0, 0, .14), 0px 1px 8px 0px rgba(0, 0, 0, .12);
881+
--mat-sys-level3: 0px 3px 5px -1px rgba(0, 0, 0, .2), 0px 6px 10px 0px rgba(0, 0, 0, .14), 0px 1px 18px 0px rgba(0, 0, 0, .12);
882+
--mat-sys-level4: 0px 5px 5px -3px rgba(0, 0, 0, .2), 0px 8px 10px 1px rgba(0, 0, 0, .14), 0px 3px 14px 2px rgba(0, 0, 0, .12);
883+
--mat-sys-level5: 0px 7px 8px -4px rgba(0, 0, 0, .2), 0px 12px 17px 2px rgba(0, 0, 0, .14), 0px 5px 22px 4px rgba(0, 0, 0, .12);
884+
```
885+
</details>
886+
665887
Level 1 elevation can be used to slightly raise the appearance of a surface. In Angular Material,
666888
this is used for the elevation of an elevated card and the handle of a slider.
667889

0 commit comments

Comments
 (0)