Repository navigation
feat(colors): update colors to be dark theme compatible - #31691
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new Ionic defaults lack regression tests covering light/dark themes, ancestor-inherited text color, background-token fallback, and explicit color/background overrides.
1 open issue
What changed in this PR
This PR improves dark-theme compatibility by aligning Ionic color contrast tokens with their backgrounds and giving ion-content theme-specific defaults.
Changes:
- Updates bold contrast tokens for backgrounds that remain dark or light across palettes.
- Splits content styles by theme, adding Ionic background-token fallback and inherited text color while preserving native defaults.
- Updates the API inventory to record content CSS properties per theme.
| File | Description |
|---|---|
core/src/themes/ionic/ionic.theme.default.scss |
Adjusts bold contrast tokens and documents their selection. |
core/src/components/content/content.tsx |
Registers separate Ionic, iOS, and MD stylesheets. |
core/src/components/content/content.native.scss |
Preserves shared native background and text defaults. |
core/src/components/content/content.md.scss |
Adds the MD stylesheet entry point. |
core/src/components/content/content.ios.scss |
Adds the iOS stylesheet entry point. |
core/src/components/content/content.ionic.scss |
Adds Ionic background fallback and text inheritance. |
core/src/components/content/content.common.scss |
Extracts shared styles from native theme dependencies. |
core/api.txt |
Lists content CSS properties for each theme. |
Review effort: Balanced
BenOsodrac
approved these changes
Nov 4, 2026
This branch was successfully deployed
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: resolves internal
What is the current behavior?
Content
On the Ionic theme,
ion-contentstill uses the native defaults: the background isvar(--ion-background-color, #fff)and the text color isvar(--ion-text-color, #000). The background does not use the design token, and the text color resets the color already set onbody, so everything inside the content gets#000instead of the default text token.Colors in dark mode
On the Ionic theme, every bold color's
contrastuses$ion-text-inverse(or$ion-text-defaultfor warning/light), which flip with the dark palette. But several bold backgrounds do not flip:What is the new behavior?
Content
ion-contentstyles are split per theme (content.common.scss,content.native.scss,content.ios.scss,content.md.scss,content.ionic.scss), following the pattern used by other components.var(--ion-background-color, $ion-bg-body).--color: currentColor), so it inherits the default text token set onbody.--background/--colorcustom properties keep working for consumers.Colors in dark mode
In the
$ionic-colorsmap (ionic.theme.default.scss), boldcontrastvalues now match how each background behaves in the dark palette:$ion-text-light, so text stays white in both modes.$ion-text-dark, so text stays near-black in both modes.$ion-text-inverse, which flips with the theme to preserve contrast.Light mode is visually unchanged for the
text-lightcolors; warning/light text shifts slightly (#242528to#131518). Reference screenshots were regenerated.Does this introduce a breaking change?
Other information