Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 0fbf631

Browse files
committed
docs(theme): clarify how to map the old foreground expressions
update links to opacity requirements for icons
1 parent 9956fe9 commit 0fbf631

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

src/core/services/theming/theming.js

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,26 @@ function detectDisabledThemes($mdThemingProvider) {
134134
* {{primary-contrast}} - Generates .md-hue-1, .md-hue-2, .md-hue-3 with configured contrast (ie. text) color shades set for each hue
135135
* {{primary-contrast-0.7}} - Apply 0.7 opacity to each of the above rules
136136
* {{primary-contrast-divider}} - Apply divider opacity to contrast color
137-
* {{background-default-contrast}} - Apply primary text color for contrasting with default background
138-
* {{background-50-contrast-icon}} - Apply contrast color for icon on background's shade 50 hue
139137
*
138+
* Foreground expansion: Applies rgba to black/white foreground text
139+
*
140+
* Old Foreground Expressions:
141+
* {{foreground-1}} - used for primary text
142+
* {{foreground-2}} - used for secondary text/divider
143+
* {{foreground-3}} - used for disabled text
144+
* {{foreground-4}} - used for dividers
145+
*
146+
* New Foreground Expressions:
147+
*
148+
* Apply primary text color for contrasting with default background
149+
* {{background-default-contrast}} - default opacity
150+
* {{background-default-contrast-secondary}} - opacity for secondary text
151+
* {{background-default-contrast-hint}} - opacity for hints and placeholders
152+
* {{background-default-contrast-disabled}} - opacity for disabled text
153+
* {{background-default-contrast-divider}} - opacity for dividers
154+
*
155+
* Apply contrast color for specific shades
156+
* {{background-50-contrast-icon}} - Apply contrast color for icon on background's shade 50 hue
140157
*/
141158

142159
// In memory generated CSS rules; registered by theme.name
@@ -190,10 +207,8 @@ var DARK_DEFAULT_HUES = {
190207
}
191208
};
192209

193-
// TODO these references no longer exist with the MD spec update of 2018.
194-
// use inactive icon opacity from https://material.google.com/style/color.html#color-text-background-colors
195-
// not inactive icon opacity from https://material.google.com/style/icons.html#icons-system-icons
196-
210+
// Icon opacity values (active/inactive) from
211+
// https://material.io/archive/guidelines/style/icons.html#icons-system-icons
197212
var DARK_CONTRAST_OPACITY = {
198213
'icon': 0.54,
199214
'secondary': 0.54,
@@ -210,6 +225,8 @@ var LIGHT_CONTRAST_OPACITY = {
210225
'divider': 0.12
211226
};
212227

228+
// Icon opacity values (active/inactive) from
229+
// https://material.io/archive/guidelines/style/icons.html#icons-system-icons
213230
var STRONG_LIGHT_CONTRAST_OPACITY = {
214231
'icon': 1.0,
215232
'secondary': 0.7,

0 commit comments

Comments
 (0)