feat(tokens): add gray and text colors#30981
Open
thetaPC wants to merge 6 commits intoionic-modularfrom
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
thetaPC
commented
Feb 27, 2026
Contributor
Author
There was a problem hiding this comment.
Deleted it because we've moved to using core/src/themes/test/color/index.html
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue number: internal
What is the current behavior?
iosandmdthemes are still using the stepped color variables.What is the new behavior?
The CSS variable
--ion-background-color-step-{number}is no longer recommended for use and has been replaced by a more intuitive and standardized naming convention as part of Ionic's new theming structure. The functionality provided by the old variable has been replaced with a new set of CSS variables that use the same color values but are named:--ion-color-gray-{number}.This new structure aligns with how other popular design systems and frameworks are setting up their color palettes (e.g., using names like
gray,red,blue, followed by a number to denote the shade). Additionally, it follows the proposal agreed upon within the design doc.The CSS variable
--ion-text-color-step-*is being replaced by--ion-color-text-*to adhere to the standardized naming convention for Ionic's new theming structure (--ion-color-*-*). This change aims for greater clarity and consistency within the framework's color palette.The original thought was to use only the
--ion-color-gray-*variables for all purposes (backgrounds, text, icons, etc.). However, it was quickly determined that text color requirements are not a 1:1 match with the gray steps designed for backgrounds and other elements. Text often requires a different shade to maintain proper contrast and readability across various theme palettes (especially between high contrast and high contrast dark modes). Introducing the dedicated functional variable--ion-color-text-*solves this issue by allowing text color to be defined independently based on the current palette's needs.Also the
--ion-color-step-*variables were removed since they were deprecated in v7.Does this introduce a breaking change?
You simply need to swap the wording of the background stepped variables with the new gray variables. The number suffix remains exactly the same:
--ion-background-color-step-50--ion-color-gray-50--ion-background-color-step-900--ion-color-gray-900You simply need to swap the wording of the text stepped variables with the new text variables. The number suffix remains exactly the same:
--ion-text-color-step-50--ion-color-text-50--ion-text-color-step-900--ion-color-text-900Other information
Preview