|
39 | 39 |
|
40 | 40 | $value: map.get($values, $variation); |
41 | 41 |
|
42 | | - // If the color requested is subtle we return `--ion-color-primary-subtle-contrast` |
43 | | - // Otherwise we return `--ion-color-primary-contrast` |
| 42 | + // TODO(FW-6417): this can be removed when foreground is required |
| 43 | + // Fallback to "base" variant when "foreground" variant is undefined |
| 44 | + @if ($variation == foreground and $value == null) { |
| 45 | + $variation: base; |
| 46 | + $value: map.get($values, $variation); |
| 47 | + } |
| 48 | + |
| 49 | + // If the color requested is subtle we return `--ion-color-{color}-subtle-contrast`, |
| 50 | + // otherwise we return `--ion-color-{color}-contrast`. |
44 | 51 | $variable: if($subtle, "--ion-color-#{$name}-subtle-#{$variation}", "--ion-color-#{$name}-#{$variation}"); |
45 | 52 |
|
46 | | - // If the variation being used is base, we do not include the variant so |
47 | | - // If the color requested is subtle we return `--ion-color-primary-subtle` |
48 | | - // Otherwise we return `--ion-color-primary` |
| 53 | + // If the variation being used is "base", we do not include the variant. |
| 54 | + // If the color requested is subtle we return `--ion-color-{color}-subtle`, |
| 55 | + // otherwise we return `--ion-color-{color}`. |
49 | 56 | @if ($variation == base) { |
50 | 57 | $variable: if($subtle, "--ion-color-#{$name}-subtle", "--ion-color-#{$name}"); |
51 | 58 | } |
|
134 | 141 | $hue-colors: map.get($theme-colors, $color-name); |
135 | 142 | $color-variants: map.get($hue-colors, $hue); |
136 | 143 |
|
137 | | - // Determine prefix based on hue value |
138 | 144 | $prefix: if($hue == "subtle", "-subtle", ""); |
139 | 145 |
|
140 | | - // TODO this @if can be removed if we add subtle colors for ios and md |
| 146 | + // TODO(FW-6417) this @if can be removed if we add subtle colors for ios and md |
141 | 147 | // Only proceed if the color variants exist |
142 | 148 | @if $color-variants { |
143 | 149 | // Grab the individual color variants |
|
159 | 165 | ) !important; |
160 | 166 | --ion-color#{$prefix}-shade: var(--ion-color-#{$color-name}#{$prefix}-shade, #{$shade}) !important; |
161 | 167 | --ion-color#{$prefix}-tint: var(--ion-color-#{$color-name}#{$prefix}-tint, #{$tint}) !important; |
162 | | - // TODO(): remove the fallback variable when the foreground variable is |
| 168 | + // TODO(FW-6417): remove the fallback variable when the foreground variable is |
163 | 169 | // required by all palettes for all themes: |
164 | 170 | // --ion-color#{$prefix}-foreground: var(--ion-color-#{$color-name}#{$prefix}-foreground, #{$foreground}) !important; |
165 | 171 | --ion-color#{$prefix}-foreground: var( |
|
235 | 241 | --ion-color-#{$color-name}#{$prefix}-contrast-rgb: #{map.get($colors, contrast-rgb)}; |
236 | 242 | --ion-color-#{$color-name}#{$prefix}-shade: #{map.get($colors, shade)}; |
237 | 243 | --ion-color-#{$color-name}#{$prefix}-tint: #{map.get($colors, tint)}; |
238 | | - // TODO(): this "if" can be removed when foreground is defined for ios/md |
| 244 | + // TODO(FW-6417): this "if" can be removed when foreground is defined for ios/md |
239 | 245 | // themes. It should not be added until we want foreground to be required for |
240 | 246 | // ios and md because this will be a breaking change, requiring users to add |
241 | 247 | // `--ion-color-{color}-foreground` in order to override the default colors |
|
0 commit comments