mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-01-21 00:40:09 +00:00
feat(tokens): Make colors from tokens.ts
reusable my setting ColorTokens
type
This commit is contained in:
parent
d86f6307a8
commit
82884cbf67
10
tokens.ts
10
tokens.ts
@ -1,6 +1,11 @@
|
||||
import { customisation } from '@status-im/colors'
|
||||
import { createTokens } from '@tamagui/core'
|
||||
import { size, space, zIndex } from '@tamagui/theme-base'
|
||||
import { size, space, zIndex } from '@tamagui/themes'
|
||||
import { ColorTokens } from 'tamagui';
|
||||
|
||||
type ColorObject = {
|
||||
[key: string]: ColorTokens;
|
||||
}
|
||||
|
||||
export const tokens = createTokens({
|
||||
color: {
|
||||
@ -200,6 +205,9 @@ export const tokens = createTokens({
|
||||
},
|
||||
})
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export const colorsTyped: ColorObject = tokens.color as { [key: string]: any };
|
||||
|
||||
type GetTokenString<A> = A extends string | number ? `$${A}` : `$${string}`
|
||||
type RadiusTokens = GetTokenString<keyof typeof tokens.radius> | number
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user