Theme colors
Home Assistant Material 3 Theme colors¶
HAM3 contains the same basic things as any Material 3 theme:
- Reference color palettes
- Surfaces
- Light theme color mapping from the reference color palettes
- Dark theme color mapping from the reference color palettes
HAM3 follows the Material 3 naming scheme, but replaces the md-
prefix with theme-
to avoid clashes with other CSS variables that start with md-
, and to make clear that the CSS variable is part of the theme.
Reference colors¶
The HAM3 implementation defines no less than 264 reference colors. Some are theme mode independent, others are specific for light or dark modes.
Palette Reference colors¶
Reference palette colors use the theme-ref-palette-
naming scheme and are theme mode independent.
Palette color schemes use 24 colors per palette and are available for:
- Neutral colors
- Neutral variant colors
- Primary colors
- Secondary colors
- Tertiary colors
- Error colors
Material 3 Reference palette colors (from example theme D07):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
|
Elevation surface Reference colors¶
Reference elevation surface colors use the theme-ref-elevation-surface-
naming scheme and are specific per theme mode by using -light
and -dark
suffixes in the name.
Surface color schemes are available for:
- Neutral colors
- Neutral variant colors
- Neutral base color mixed with the primary color
- Neutral base color mixed with the secundary color
- Neutral base color mixed with the tertiary color
- Neutral base color mixed with the error color
Material 3 Reference elevation surface colors (from example theme D07):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
|
System colors¶
M3 System colors are by definition independent of the theme mode. Their actual value adapts to the light or dark mode.
The theme-sys-color-
definitions make up the theme.
Standard Material 3 light and dark system colors¶
Material 3 System colors mapping for LIGHT mode
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
Material 3 System colors mapping for DARK mode
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
Standard Material 3 elevation surface light and dark colors¶
Material 3 elevation surface color mapping for LIGHT mode
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
Material 3 elevation surface color mapping for DARK mode
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
Material 3 Mapping to HA/Material 2 color names¶
Home Assistant uses both Material and dedicated CSS variables to define the used colors.
HAM3 maps the Material 3 colors to these colors. This way, Home Assistant just works with these themes.
Some examples of these color mappings are:
- primary-background-color
- secondary-background-color
- ...
- primary-color
- secondary-color
- accent-color
- ...
- primary-text-color
- secondary-text-color
- card-background-color
- box-shadow-light/dark-color
And more, like icons, switches, labels and the colors used by the energy dashboard: these are more subdued for the dark theme as advised by the Material 3 Design Specifications from Google.