Skip to content

Commit 0a3c7d6

Browse files
BenOsodracIonitron
andauthored
feat(tokens): update tokens usage to reflect UI architecture (#30678)
Issue number: internal --------- ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> This pull request updates the color and background variables across many Ionic component styles to use new design system tokens, improving consistency and maintainability. It also temporarily skips several visual regression tests for the `datetime` component due to a known issue (FW-6769). **Design System Token Migration:** * Updated `--color` and `--background` variables in many components (e.g., `card`, `card-title`, `list-header`, `item`, `segment`, `radio`, `select`, `textarea`, `input`, `checkbox`, `chip`, `datetime`, `item-options`, `searchbar`) to use the new `globals.$ion-text-default` and `globals.$ion-bg-surface-default` tokens instead of older primitives. This change ensures consistent theming and easier future maintenance. [[1]](diffhunk://#diff-efdc0d0b924ff22b22228f52baebe09c69cce416ab33ba4a572c678ba3aa38f8L16-R16) [[2]](diffhunk://#diff-c213fde8dd24fa2839aa2744fc6d06635c2a8e5f50f93996afa63592299eae84L8-R8) [[3]](diffhunk://#diff-ff9d7e4249d9ff015206ca8f6ce3553d6217ae196bccdb0e4fbd26b93b45489dL8-R13) [[4]](diffhunk://#diff-796ffc72b6171910c25d5aad085bc245095c38f104d55e253e06282702205066L33-R33) [[5]](diffhunk://#diff-796ffc72b6171910c25d5aad085bc245095c38f104d55e253e06282702205066L63-R63) [[6]](diffhunk://#diff-3c751a473bd2fa61cfd77529c7b9e496f34cf198a4aed0bea0b57d1a1f7fe40aL120-R126) [[7]](diffhunk://#diff-5df43981fd8a3a93e815ade41875432d0620892c30ae86858821a1270087fef6L12-R12) [[8]](diffhunk://#diff-5df43981fd8a3a93e815ade41875432d0620892c30ae86858821a1270087fef6L143-R143) [[9]](diffhunk://#diff-5df43981fd8a3a93e815ade41875432d0620892c30ae86858821a1270087fef6L214-R214) [[10]](diffhunk://#diff-cbf91c9b97e425d969df4730e12b3424dd54de7664b9e629d455d2e63539c84eL4-R4) [[11]](diffhunk://#diff-4d89e41650632cecdd15dbe6b2ef5ad30d100788ecd786dd97a990aaf1ab08d9L9-R9) [[12]](diffhunk://#diff-690dbcc4c16a68fc142652cfda82fe7c2008b27a7fcb63dac7e2926598edced2L14-R14) [[13]](diffhunk://#diff-00b462d69386f16806ec2f51ec487d3c47faadfbe68f3b718d336642c80379beL8-R13) [[14]](diffhunk://#diff-bb3e65e73d30ca817f259cc0f805118bfbdee6ce562dd7171afddbca03b7265aL6-R6) [[15]](diffhunk://#diff-c55248a8c9a55b4714cca5b2daa538f3bff0d1260b9249af1b20f7e845a72741L20-R20) [[16]](diffhunk://#diff-c55248a8c9a55b4714cca5b2daa538f3bff0d1260b9249af1b20f7e845a72741L58-R58) [[17]](diffhunk://#diff-c55248a8c9a55b4714cca5b2daa538f3bff0d1260b9249af1b20f7e845a72741L70-R70) [[18]](diffhunk://#diff-36e6af13208ea67992ffd6ac4cb84d0dceea7fb8ca0bcfaccb578d9ac296c9aaL17-R17) [[19]](diffhunk://#diff-8409cb5f296c6ba6c9e0747c7eb6d6f837935bc158bb42406631669d6fcc12b3L8-R8) [[20]](diffhunk://#diff-030647f0cfb9ca6f042e9d7114611c7076a7c01af73076d1db05cc881b40ddf7L9-R9) [[21]](diffhunk://#diff-030647f0cfb9ca6f042e9d7114611c7076a7c01af73076d1db05cc881b40ddf7L165-R165) [[22]](diffhunk://#diff-45914a3d091d2c33732c1bdfbd74ce4375d12c6b23811c211a038d829e110886L10-R16) **Test Suite Maintenance:** * Temporarily skipped several E2E visual regression tests for datetime and item components, referencing TODO FW-6769, to prevent test failures while an upstream issue is addressed. [[1]](diffhunk://#diff-28d032b5dd4c52cbf575dd85894b936c883d43093a03b1e5fca940ee3a626cb3L31-R32) [[2]](diffhunk://#diff-6bcce71748a9d3fff9d03f4829f9ee2f058ff2ff419e5a0168f6b1200e29ba0fL33-R34) [[3]](diffhunk://#diff-6bcce71748a9d3fff9d03f4829f9ee2f058ff2ff419e5a0168f6b1200e29ba0fL87-R89) [[4]](diffhunk://#diff-5c6fab9ab164e203679ae4adfafbc0c4c84c569e8fc37f788f5688707cdd283bL16-R17) [[5]](diffhunk://#diff-eac254ce4208c500e31c420e6919b2141fb67c875b062b6d8cbbe3b262216cedL32-R33) There're some snapshots updates that seem to have no visible differences, so I would say its ok to accept the new ones. ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- 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/docs/CONTRIBUTING.md#footer for more information. --> --------- Co-authored-by: ionitron <[email protected]>
1 parent 2dd212d commit 0a3c7d6

File tree

64 files changed

+49
-43
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+49
-43
lines changed

core/src/components/buttons/buttons.ionic.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// --------------------------------------------------
1414

1515
::slotted(*) .button-clear {
16-
--color: #{globals.$ion-primitives-neutral-1200};
16+
--color: #{globals.$ion-text-default};
1717
--background: transparent;
1818
--background-activated: transparent;
1919
--background-focused: transparent;

core/src/components/card-title/card-title.ionic.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// --------------------------------------------------
66

77
:host {
8-
--color: #{globals.$ion-primitives-neutral-1200};
8+
--color: #{globals.$ion-text-default};
99

1010
@include globals.typography(globals.$ion-heading-h5-medium);
1111
}

core/src/components/card/card.ionic.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
// --------------------------------------------------
66

77
:host {
8-
--background: #{globals.$ion-primitives-base-white};
8+
--background: #{globals.$ion-bg-surface-default};
99
--border-width: #{globals.$ion-border-size-025};
1010
--border-color: #{globals.$ion-border-default};
1111
--border-style: #{globals.$ion-border-style-solid};
1212
--border-radius: #{globals.$ion-round-xl};
13-
--color: #{globals.$ion-primitives-neutral-1200};
13+
--color: #{globals.$ion-text-default};
1414
min-width: globals.$ion-scale-2400;
1515

1616
border: var(--border-width) var(--border-style) var(--border-color);

core/src/components/checkbox/checkbox.ionic.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
--checkbox-background: #{globals.$ion-bg-input-default};
3131
--checkbox-background-checked: #{globals.$ion-bg-primary-base-default};
3232
--border-color-checked: #{globals.$ion-semantics-primary-base};
33-
--checkmark-color: #{globals.$ion-primitives-base-white};
33+
--checkmark-color: #{globals.$ion-bg-surface-default};
3434
--transition: none;
3535

3636
z-index: 2;
@@ -60,7 +60,7 @@
6060
}
6161

6262
.label-text-wrapper {
63-
color: globals.$ion-primitives-neutral-1200;
63+
color: globals.$ion-text-default;
6464
}
6565

6666
:host(.in-item) .label-text-wrapper {

core/src/components/chip/chip.ionic.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@
117117

118118
:host(.chip-bold) {
119119
--background: #{globals.$ion-bg-neutral-bold-default};
120-
--color: #{globals.$ion-primitives-base-white};
120+
--color: #{globals.$ion-bg-surface-default};
121121
}
122122

123123
:host(.chip-outline.chip-bold) {
124124
// TODO(FW-6450): this is a made up design choice based on a
125125
// darker shade of the background color
126-
border-color: globals.$ion-primitives-neutral-1200;
126+
border-color: globals.$ion-text-default;
127127
}
128128

129129
// Chip Colors

core/src/components/datetime/datetime.ionic.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* @prop --focus-ring-color: The color of the ring around the focused element.
1010
* @prop --focus-ring-width: The width of the ring around the focused element.
1111
*/
12-
--background: #{globals.$ion-primitives-base-white};
12+
--background: #{globals.$ion-bg-surface-default};
1313
--focus-ring-color: #{globals.$ion-border-focus-default};
1414
--focus-ring-width: #{globals.$ion-border-radius-025};
1515
}
@@ -140,7 +140,7 @@
140140

141141
height: globals.$ion-scale-1200;
142142

143-
color: globals.$ion-primitives-neutral-1200;
143+
color: globals.$ion-text-default;
144144
}
145145

146146
// Disabled Day
@@ -211,7 +211,7 @@
211211
height: globals.$ion-scale-800;
212212

213213
background-color: globals.$ion-primitives-neutral-100;
214-
color: globals.$ion-primitives-neutral-1200;
214+
color: globals.$ion-text-default;
215215
}
216216

217217
// Calendar / Footer / Action Buttons

core/src/components/datetime/test/custom/datetime.e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
2828
await expect(popover).toHaveScreenshot(screenshot(`datetime-custom-time-picker`));
2929
await expect(timeButton).toHaveScreenshot(screenshot(`datetime-custom-time-button-active`));
3030
});
31-
32-
test('should allow styling calendar days in grid style datetimes', async ({ page }) => {
31+
// TODO (FW-6769): Enable test when its fixed
32+
test.skip('should allow styling calendar days in grid style datetimes', async ({ page }) => {
3333
const datetime = page.locator('#custom-calendar-days');
3434

3535
// Wait for calendar days to be rendered

core/src/components/datetime/test/display/datetime.e2e.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ configs({ modes: ['ios', 'md', 'ionic-md'], directions: ['ltr'] }).forEach(({ ti
3030
const datetime = page.locator('ion-datetime');
3131
await expect(datetime).toHaveScreenshot(screenshot(`datetime-display-time-date`));
3232
});
33-
test('time should not have any visual regressions', async ({ page }) => {
33+
// TODO (FW-6769): Enable test when its fixed
34+
test.skip('time should not have any visual regressions', async ({ page }) => {
3435
await page.setContent(
3536
`
3637
<ion-datetime value="2022-02-22T16:30:00" presentation="time"></ion-datetime>
@@ -84,7 +85,8 @@ configs({ modes: ['ios', 'md', 'ionic-md'], directions: ['ltr'] }).forEach(({ ti
8485
const datetime = page.locator('ion-datetime');
8586
await expect(datetime).toHaveScreenshot(screenshot(`datetime-display-cover-time-date`));
8687
});
87-
test('time should not have any visual regressions', async ({ page }) => {
88+
// TODO (FW-6769): Enable test when its fixed
89+
test.skip('time should not have any visual regressions', async ({ page }) => {
8890
await page.setContent(
8991
`
9092
<ion-datetime size="cover" value="2022-02-22T16:30:00" presentation="time"></ion-datetime>

core/src/components/datetime/test/show-adjacent-days/datetime.e2e.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ configs({ modes: ['ios', 'md', 'ionic-md'], directions: ['ltr'] }).forEach(({ ti
1313
await expect(datetime).toHaveScreenshot(screenshot(`datetime-show-adjacent-days`));
1414
});
1515

16-
test('should not have visual regressions with a custom styled calendar', async ({ page }) => {
16+
// TODO (FW-6769): Enable test when its fixed
17+
test.skip('should not have visual regressions with a custom styled calendar', async ({ page }) => {
1718
await page.goto('/src/components/datetime/test/show-adjacent-days', config);
1819
await page.locator('.datetime-ready').first().waitFor();
1920
const datetime = page.locator('#custom-calendar-days');
-38 Bytes

0 commit comments

Comments
 (0)