Skip to content

Commit

Permalink
Merge pull request #5 from tokens-studio/number-types
Browse files Browse the repository at this point in the history
fix: expand some token value types to allow number
  • Loading branch information
jorenbroekema authored Mar 19, 2023
2 parents 8400e16 + 90e52b7 commit 4952247
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/plenty-hornets-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tokens-studio/types': patch
---

Expand certain types to also allow number to be passed in, if this is possible in CSS for example.
2 changes: 1 addition & 1 deletion src/types/tokens/SingleFontWeightsToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SingleGenericToken } from './SingleGenericToken';

export type SingleFontWeightsToken<Named extends boolean = true, P = unknown> = SingleGenericToken<
TokenTypes.FONT_WEIGHTS,
string,
string | number,
Named,
P
>;
2 changes: 1 addition & 1 deletion src/types/tokens/SingleGenericToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ColorModifier } from '../Modifier';

export type SingleGenericToken<
T extends TokenTypes,
V = string,
V = string | number,
Named extends boolean = true,
P = unknown,
> = {
Expand Down
2 changes: 1 addition & 1 deletion src/types/tokens/SingleLineHeightsToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SingleGenericToken } from './SingleGenericToken';

export type SingleLineHeightsToken<Named extends boolean = true, P = unknown> = SingleGenericToken<
TokenTypes.LINE_HEIGHTS,
string,
string | number,
Named,
P
>;
2 changes: 1 addition & 1 deletion src/types/tokens/SingleOpacityToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SingleGenericToken } from './SingleGenericToken';

export type SingleOpacityToken<Named extends boolean = true, P = unknown> = SingleGenericToken<
TokenTypes.OPACITY,
string,
string | number,
Named,
P
>;
2 changes: 1 addition & 1 deletion src/types/tokens/SingleOtherToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SingleGenericToken } from './SingleGenericToken';

export type SingleOtherToken<Named extends boolean = true, P = unknown> = SingleGenericToken<
TokenTypes.OTHER,
string,
string | number,
Named,
P
>;
2 changes: 1 addition & 1 deletion src/types/tokens/SingleTextToken.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { TokenTypes } from '../../constants/TokenTypes';
import { SingleGenericToken } from './SingleGenericToken';

// @TODO remove text type token if not used anymore
// TODO: remove text type token if not used anymore
export type SingleTextToken<Named extends boolean = true, P = unknown> = SingleGenericToken<
TokenTypes.TEXT,
string,
Expand Down

0 comments on commit 4952247

Please sign in to comment.