Skip to content

Commit 16f91ab

Browse files
committed
feat(many): use text color tokens
1 parent 10e091b commit 16f91ab

File tree

85 files changed

+705
-353
lines changed

Some content is hidden

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

85 files changed

+705
-353
lines changed

core/scripts/testing/scripts.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ const DEFAULT_THEME = 'md';
8787
* Values can be `light`, `dark`, `high-contrast`,
8888
* or `high-contrast-dark`. Default to `light` for tests.
8989
*/
90-
const paletteQuery = window.location.search.match(/palette=([a-z]+)/);
91-
const paletteHash = window.location.hash.match(/palette=([a-z]+)/);
90+
const paletteQuery = window.location.search.match(/palette=([a-z-]+)/);
91+
const paletteHash = window.location.hash.match(/palette=([a-z-]+)/);
9292
const darkClass = document.body?.classList.contains('ion-palette-dark') ? 'dark' : null;
9393

9494
const paletteName = paletteQuery?.[1] || paletteHash?.[1] || darkClass || 'light';
@@ -113,12 +113,18 @@ const DEFAULT_THEME = 'md';
113113
// to set the enabled property to 'always'
114114
if (paletteName === 'dark' && theme.palette?.dark) {
115115
theme.palette.dark.enabled = 'always';
116+
} else if (paletteName === 'high-contrast' && theme.palette?.highContrast) {
117+
theme.palette.highContrast.enabled = 'always';
118+
} else if (paletteName === 'high-contrast-dark' && theme.palette?.highContrastDark) {
119+
theme.palette.highContrastDark.enabled = 'always';
116120
}
117121

118122
// Apply the theme tokens to Ionic config
119123
window.Ionic = window.Ionic || {};
120124
window.Ionic.config = window.Ionic.config || {};
121125
window.Ionic.config.customTheme = theme;
126+
console.log(`Applied ${themeName} theme with ${paletteName} palette.`);
127+
console.log('theme:', theme);
122128

123129
// Re-apply the global theme
124130
if (window.Ionic.config.get && window.Ionic.config.set) {

core/src/components/action-sheet/action-sheet.ios.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
--button-background-selected: #{$action-sheet-ios-button-background-selected};
1818
--button-background-selected-opacity: 1;
1919
--button-color: #{$action-sheet-ios-button-text-color};
20-
--button-color-disabled: var(--ion-color-gray-850);
20+
--button-color-disabled: var(--ion-color-text-850);
2121
--color: #{$action-sheet-ios-title-color};
2222

2323
text-align: $action-sheet-ios-text-align;

core/src/components/action-sheet/action-sheet.ios.vars.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ $action-sheet-ios-group-margin-top: 10px;
2525
$action-sheet-ios-group-margin-bottom: 10px;
2626

2727
/// @prop - Background color of the action sheet
28-
$action-sheet-ios-background-color: $overlay-ios-background-color;
28+
$action-sheet-ios-background-color: var(--ion-color-overlay-bg);
2929

3030
/// @prop - Border radius of the action sheet
3131
$action-sheet-ios-border-radius: 13px;
@@ -46,7 +46,7 @@ $action-sheet-ios-title-padding-bottom: 13px;
4646
$action-sheet-ios-title-padding-start: $action-sheet-ios-title-padding-end;
4747

4848
/// @prop - Color of the action sheet title
49-
$action-sheet-ios-title-color: var(--ion-color-gray-400);
49+
$action-sheet-ios-title-color: var(--ion-color-text-400);
5050

5151
/// @prop - Font size of the action sheet title
5252
$action-sheet-ios-title-font-size: dynamic-font-min(1, 13px);
@@ -115,7 +115,7 @@ $action-sheet-ios-button-background: linear-gradient(
115115
$action-sheet-ios-button-background-activated: $text-color;
116116

117117
/// @prop - Background color of the selected action sheet button
118-
$action-sheet-ios-button-background-selected: var(--ion-color-gray-0);
118+
$action-sheet-ios-button-background-selected: var(--ion-components-ion-action-sheet-button-bg-selected);
119119

120120
/// @prop - Destructive text color of the action sheet button
121121
$action-sheet-ios-button-destructive-text-color: ion-color(danger, base);

core/src/components/action-sheet/action-sheet.md.vars.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ $action-sheet-md-sub-title-padding-start: $action-sheet-md-sub-title-padding-end
6464
$action-sheet-md-button-height: 52px;
6565

6666
/// @prop - Text color of the action sheet button
67-
$action-sheet-md-button-text-color: var(--ion-color-gray-850);
67+
$action-sheet-md-button-text-color: var(--ion-color-text-850);
6868

6969
/// @prop - Font size of the action sheet button
7070
$action-sheet-md-button-font-size: dynamic-font(16px);

core/src/components/alert/alert.ios.vars.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $alert-ios-max-width: dynamic-font-clamp(1, 270px, 1.2);
1515
$alert-ios-border-radius: 13px;
1616

1717
/// @prop - Background color of the alert
18-
$alert-ios-background-color: $overlay-ios-background-color;
18+
$alert-ios-background-color: var(--ion-color-overlay-bg);
1919

2020
/// @prop - Background color alpha of the alert when translucent
2121
$alert-ios-translucent-background-color-alpha: 0.9;
@@ -57,7 +57,7 @@ $alert-ios-title-font-weight: 600;
5757
$alert-ios-sub-title-font-size: dynamic-font-min(1, 14px);
5858

5959
/// @prop - Text color of the alert sub title
60-
$alert-ios-sub-title-text-color: var(--ion-color-gray-600);
60+
$alert-ios-sub-title-text-color: var(--ion-color-text-600);
6161

6262
/// @prop - Padding top of the alert message
6363
$alert-ios-message-padding-top: 0;
@@ -114,7 +114,7 @@ $alert-ios-input-padding-start: $alert-ios-input-padding-end;
114114
$alert-ios-input-placeholder-color: $placeholder-text-color;
115115

116116
/// @prop - Border color of the alert input
117-
$alert-ios-input-border-color: var(--ion-color-gray-250);
117+
$alert-ios-input-border-color: var(--ion-color-text-250);
118118

119119
/// @prop - Border of the alert input
120120
$alert-ios-input-border: $hairlines-width solid $alert-ios-input-border-color;
@@ -276,7 +276,7 @@ $alert-ios-checkbox-border-style: solid;
276276
$alert-ios-checkbox-border-radius: 50%;
277277

278278
/// @prop - Border color of the checkbox in the alert when off
279-
$alert-ios-checkbox-border-color-off: $item-ios-border-color;
279+
$alert-ios-checkbox-border-color-off: var(--ion-components-ion-item-border-color);
280280

281281
/// @prop - Border color of the checkbox in the alert when on
282282
$alert-ios-checkbox-border-color-on: ion-color(primary, base);

core/src/components/alert/alert.md.vars.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ $alert-md-message-padding-start: $alert-md-message-padding-end;
8080
$alert-md-message-font-size: dynamic-font(16px);
8181

8282
/// @prop - Text color of the alert message
83-
$alert-md-message-text-color: var(--ion-color-gray-550);
83+
$alert-md-message-text-color: var(--ion-color-text-550);
8484

8585
/// @prop - Padding top of the alert empty message
8686
$alert-md-message-empty-padding-top: 0;
@@ -254,7 +254,7 @@ $alert-md-radio-label-padding-start: $alert-md-radio-label-padding-end + 26px;
254254
$alert-md-radio-label-font-size: dynamic-font(16px);
255255

256256
/// @prop - Text color of the label for the radio alert
257-
$alert-md-radio-label-text-color: var(--ion-color-gray-850);
257+
$alert-md-radio-label-text-color: var(--ion-color-text-850);
258258

259259
/// @prop - Text color of the label for the checked radio alert
260260
$alert-md-radio-label-text-color-checked: $alert-md-radio-label-text-color;
@@ -323,7 +323,7 @@ $alert-md-checkbox-label-padding-bottom: $alert-md-checkbox-label-padding-top;
323323
$alert-md-checkbox-label-padding-start: $alert-md-checkbox-label-padding-end + 27px;
324324

325325
/// @prop - Text color of the label for the checkbox in the alert
326-
$alert-md-checkbox-label-text-color: var(--ion-color-gray-850);
326+
$alert-md-checkbox-label-text-color: var(--ion-color-text-850);
327327

328328
/// @prop - Font size of the label for the checkbox in the alert
329329
$alert-md-checkbox-label-font-size: dynamic-font(16px);

core/src/components/alert/test/basic/alert.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ configs().forEach(({ config, screenshot, title }) => {
103103

104104
configs({ palettes: ['light', 'dark'] }).forEach(({ config, screenshot, title }) => {
105105
test.describe(title('should not have visual regressions'), () => {
106-
test('more than two buttons', async ({ page }) => {
106+
test.only('more than two buttons', async ({ page }) => {
107107
await page.setContent(
108108
`
109109
<ion-alert

core/src/components/card-subtitle/card-subtitle.ios.vars.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ $card-ios-subtitle-margin-bottom: 4px;
4040
$card-ios-subtitle-margin-start: $card-ios-subtitle-margin-end;
4141

4242
/// @prop - Color of the card subtitle
43-
$card-ios-subtitle-color: var(--ion-color-gray-600);
43+
$card-ios-subtitle-color: var(--ion-color-text-600);

core/src/components/card-subtitle/card-subtitle.md.vars.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ $card-md-subtitle-margin-bottom: 0;
3131
$card-md-subtitle-margin-start: $card-md-subtitle-margin-end;
3232

3333
/// @prop - Color of the card subtitle
34-
$card-md-subtitle-color: var(--ion-color-gray-550);
34+
$card-md-subtitle-color: var(--ion-color-text-550);

core/src/components/card-title/card-title.md.vars.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ $card-md-title-margin-bottom: $card-md-title-margin-top;
3131
$card-md-title-margin-start: $card-md-title-margin-end;
3232

3333
/// @prop - Color of the card title
34-
$card-md-title-text-color: var(--ion-color-gray-850);
34+
$card-md-title-text-color: var(--ion-color-text-850);

0 commit comments

Comments
 (0)