fix(datetime): set default background color correctly (#28809)

Issue number: None
---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->
In my work for FW-5822, I found that I had unexpected screenshot diffs.
`--ion-color-light` was not defined in our test infrastructure, and the
white fallback for the datetime background was causing snapshots to have
a white background when they should have had a light one.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Datetime has the correct background color even when the
`--ion-color-light` token is not defined

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

Introduces style changes if the token is undefined, but it should always
be defined in real-world uses.

<!--
  If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
  2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer
for more information.
-->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

---------

Co-authored-by: ionitron <hi@ionicframework.com>
This commit is contained in:
Shawn Taylor
2024-01-10 15:46:07 -05:00
committed by GitHub
parent d42f5ed78b
commit 3929b0188a
7 changed files with 2 additions and 2 deletions

View File

@ -3,8 +3,8 @@
@import "../../themes/ionic.globals.ios";
:host {
--background: var(--ion-color-light, #ffffff);
--background-rgb: var(--ion-color-light-rgb);
--background: #{ion-color(light, base)};
--background-rgb: #{ion-color(light, base, null, true)};
--title-color: #{$text-color-step-400};
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB