Skip to content

Commit

Permalink
fix: let useCurrentColor access token colors
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjskaltsis authored and natew committed Dec 12, 2022
1 parent 6e06325 commit 2ecd6c2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/helpers-tamagui/src/useCurrentColor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ import type { TextStyle } from 'react-native'

export const useCurrentColor = (colorProp: ColorProp) => {
const theme = useTheme()
return variableToString(theme[colorProp as any] || colorProp || theme.color)
const tokens = getTokens(true)
return variableToString(
theme[colorProp as any] ||
tokens.color[colorProp as any] ||
colorProp ||
theme.color
)
}

export type ColorProp = ThemeValueFallback | ColorTokens | TextStyle['color'] | undefined

1 comment on commit 2ecd6c2

@vercel
Copy link

@vercel vercel bot commented on 2ecd6c2 Dec 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

site – ./

site-tamagui.vercel.app
site-git-master-tamagui.vercel.app
site-beta-beige.vercel.app

Please sign in to comment.