[X] I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
v7.x, v8.x
Current Behavior
If an Ionic app has DARK mode active, there are "step" color variables defined, which are named "--ion-background-color-step-50", "--ion-background-color-step-100", etc., up to "--ion-background-color-step-950". Also there are contrasting "step" colors for text named "--ion-text-color-step-50", etc.
These step colors work as expected in DARK mode. However, if the app is put into LIGHT mode, these variables are not defined at all. This results in plain white for any color CSS attribute that tries to use them in LIGHT mode.
Expected Behavior
The "step" color definitions should work both in LIGHT mode and DARK mode, although the definitions for LIGHT mode should be the inverse of dark mode. That is, the "--ion-background-color-step-100" for LIGHT mode should be the same value as the "--ion-background-color-step-900" for DARK mode.
Steps to Reproduce
Place some CSS into an Ionic app that references a "step" color, such as:
NodeJS : v20.14.0 (C:\local\nodejs\node.exe)
npm : 10.8.1
OS : Windows 10
Additional Information
As a workaround, a project can add the following to the theme/variables.css file. However, this just uses the Android MD colors, and does not differentiate between iOS and MD platforms (the definitions in the Ionic source code have slightly different color values for iOS and MD in DARK mode).
Prerequisites
Ionic Framework Version
v7.x, v8.x
Current Behavior
If an Ionic app has DARK mode active, there are "step" color variables defined, which are named "--ion-background-color-step-50", "--ion-background-color-step-100", etc., up to "--ion-background-color-step-950". Also there are contrasting "step" colors for text named "--ion-text-color-step-50", etc.
These step colors work as expected in DARK mode. However, if the app is put into LIGHT mode, these variables are not defined at all. This results in plain white for any color CSS attribute that tries to use them in LIGHT mode.
Expected Behavior
The "step" color definitions should work both in LIGHT mode and DARK mode, although the definitions for LIGHT mode should be the inverse of dark mode. That is, the "--ion-background-color-step-100" for LIGHT mode should be the same value as the "--ion-background-color-step-900" for DARK mode.
Steps to Reproduce
Code Reproduction URL
https://github.com/ejohanson-vi3/step-colors
Ionic Info
Ionic:
Ionic CLI : 7.2.0 (C:\local\nodejs\node_modules\@ionic\cli) Ionic Framework : @ionic/vue 8.2.0
Capacitor:
Capacitor CLI : 6.0.0 @capacitor/android : 6.0.0 @capacitor/core : 6.0.0 @capacitor/ios : 6.0.0
Utility:
cordova-res : 0.15.4 native-run : 2.0.1
System:
NodeJS : v20.14.0 (C:\local\nodejs\node.exe) npm : 10.8.1 OS : Windows 10
Additional Information
As a workaround, a project can add the following to the
theme/variables.css
file. However, this just uses the Android MD colors, and does not differentiate between iOS and MD platforms (the definitions in the Ionic source code have slightly different color values for iOS and MD in DARK mode).