Skip to content

Commit 9b0782c

Browse files
committed
feat(tokens): update md and add default primitives
1 parent fc40c77 commit 9b0782c

File tree

7 files changed

+39
-7
lines changed

7 files changed

+39
-7
lines changed

core/src/themes/base/dark.tokens.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { mix } from '../../utils/theme';
22
import type { DarkTheme } from '../themes.interfaces';
33

4+
import { defaultPrimitiveColors } from './default.tokens.primitives';
5+
46
const colors = {
57
primary: '#4d8dff',
68
secondary: '#46b1ff',
@@ -218,5 +220,8 @@ export const darkTheme: DarkTheme = {
218220
IonItem: {
219221
background: '#000000',
220222
},
223+
IonDatetime: {
224+
background: defaultPrimitiveColors.gray['50']!,
225+
},
221226
},
222227
};
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { generateColorSteps } from '../../utils/theme';
2+
3+
// TODO: ADD TYPE
4+
export const defaultPrimitiveColors = {
5+
// TODO: Update hex values to use the text color variable and background color variable
6+
gray: generateColorSteps('#fff', '#000'),
7+
white: '#ffffff',
8+
black: '#000000',
9+
};

core/src/themes/base/default.tokens.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { generateColorSteps } from '../../utils/theme';
21
import type { DefaultTheme } from '../themes.interfaces';
32

43
import { darkTheme } from './dark.tokens';
4+
import { defaultPrimitiveColors } from './default.tokens.primitives';
55
import { lightTheme } from './light.tokens';
66

77
export const defaultTheme: DefaultTheme = {
@@ -163,7 +163,6 @@ export const defaultTheme: DefaultTheme = {
163163
},
164164

165165
color: {
166-
// TODO: Update hex values to use the text color variable and background color variable
167-
gray: generateColorSteps('#fff', '#000'),
166+
...defaultPrimitiveColors,
168167
},
169168
};

core/src/themes/base/light.tokens.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { mix } from '../../utils/theme';
22
import type { LightTheme } from '../themes.interfaces';
33

4+
import { defaultPrimitiveColors } from './default.tokens.primitives';
5+
46
const colors = {
57
primary: '#0054e9',
68
secondary: '#0163aa',
@@ -160,4 +162,9 @@ export const lightTheme: LightTheme = {
160162
},
161163
},
162164
},
165+
components: {
166+
IonDatetime: {
167+
background: defaultPrimitiveColors.gray['50']!,
168+
},
169+
},
163170
};

core/src/themes/md/dark.tokens.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { generateColorSteps } from '../../utils/theme';
22
import { darkTheme as baseDarkTheme } from '../base/dark.tokens';
33
import type { DarkTheme } from '../themes.interfaces';
44

5+
const graySteps = generateColorSteps('#ffffff', '#121212', true);
6+
57
export const darkTheme: DarkTheme = {
68
...baseDarkTheme,
79

@@ -56,7 +58,7 @@ export const darkTheme: DarkTheme = {
5658

5759
color: {
5860
// TODO: Update hex values to use the text color variable and background color variable
59-
gray: generateColorSteps('#ffffff', '#121212', true),
61+
gray: graySteps,
6062
},
6163

6264
components: {
@@ -72,5 +74,8 @@ export const darkTheme: DarkTheme = {
7274
IonTabBar: {
7375
background: '#1f1f1f',
7476
},
77+
IonDatetime: {
78+
background: graySteps['100']!,
79+
},
7580
},
7681
};

core/src/themes/md/light.tokens.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
import { defaultPrimitiveColors } from '../base/default.tokens.primitives';
12
import type { LightTheme } from '../themes.interfaces';
23

3-
export const lightTheme: LightTheme = {};
4+
export const lightTheme: LightTheme = {
5+
components: {
6+
IonDatetime: {
7+
background: defaultPrimitiveColors.white,
8+
},
9+
},
10+
};

core/src/themes/themes.interfaces.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,10 @@ export type NumberStringKeys = {
268268
};
269269

270270
// Primitive color keys
271-
type PrimitiveColors = 'gray';
271+
export type PrimitiveColors = 'gray' | 'black' | 'white';
272272

273273
// Colors interface
274-
type Colors = {
274+
export type Colors = {
275275
[K in PredefinedColors]?: SemanticHue;
276276
} & {
277277
[K in PrimitiveColors]?: NumberStringKeys;

0 commit comments

Comments
 (0)