@@ -134,9 +134,26 @@ function detectDisabledThemes($mdThemingProvider) {
134
134
* {{primary-contrast}} - Generates .md-hue-1, .md-hue-2, .md-hue-3 with configured contrast (ie. text) color shades set for each hue
135
135
* {{primary-contrast-0.7}} - Apply 0.7 opacity to each of the above rules
136
136
* {{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
139
137
*
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
140
157
*/
141
158
142
159
// In memory generated CSS rules; registered by theme.name
@@ -190,10 +207,8 @@ var DARK_DEFAULT_HUES = {
190
207
}
191
208
} ;
192
209
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
197
212
var DARK_CONTRAST_OPACITY = {
198
213
'icon' : 0.54 ,
199
214
'secondary' : 0.54 ,
@@ -210,6 +225,8 @@ var LIGHT_CONTRAST_OPACITY = {
210
225
'divider' : 0.12
211
226
} ;
212
227
228
+ // Icon opacity values (active/inactive) from
229
+ // https://material.io/archive/guidelines/style/icons.html#icons-system-icons
213
230
var STRONG_LIGHT_CONTRAST_OPACITY = {
214
231
'icon' : 1.0 ,
215
232
'secondary' : 0.7 ,
@@ -1009,16 +1026,16 @@ function parseRules(theme, colorType, rules) {
1009
1026
return theme . foregroundShadow ;
1010
1027
} else if ( theme . foregroundPalette [ hue ] ) {
1011
1028
// Use user defined palette number (ie: foreground-2)
1012
- return rgba ( colorToRgbaArray ( theme . foregroundPalette [ hue ] ) ) ;
1029
+ return rgba ( colorToRgbaArray ( theme . foregroundPalette [ hue ] ) ) ;
1013
1030
} else if ( theme . foregroundPalette [ '1' ] ) {
1014
- return rgba ( colorToRgbaArray ( theme . foregroundPalette [ '1' ] ) ) ;
1031
+ return rgba ( colorToRgbaArray ( theme . foregroundPalette [ '1' ] ) ) ;
1015
1032
}
1016
1033
// Default to background-default-contrast-{opacity}
1017
1034
colorType = 'background' ;
1018
1035
contrast = 'contrast' ;
1019
1036
if ( ! opacity && hue ) {
1020
1037
// Convert references to legacy hues to opacities (i.e. foreground-4 to *-divider)
1021
- switch ( hue ) {
1038
+ switch ( hue ) {
1022
1039
// hue-1 uses default opacity
1023
1040
case '2' :
1024
1041
opacity = 'secondary' ;
@@ -1206,7 +1223,7 @@ function generateAllThemes($injector, $mdTheming) {
1206
1223
return 'light' ;
1207
1224
}
1208
1225
function getContrastColor ( contrastType ) {
1209
- switch ( contrastType ) {
1226
+ switch ( contrastType ) {
1210
1227
default :
1211
1228
case 'strongLight' :
1212
1229
return STRONG_LIGHT_CONTRAST_COLOR ;
@@ -1217,7 +1234,7 @@ function generateAllThemes($injector, $mdTheming) {
1217
1234
}
1218
1235
}
1219
1236
function getOpacityValues ( contrastType ) {
1220
- switch ( contrastType ) {
1237
+ switch ( contrastType ) {
1221
1238
default :
1222
1239
case 'strongLight' :
1223
1240
return STRONG_LIGHT_CONTRAST_OPACITY ;
0 commit comments