Last active
October 27, 2023 12:24
-
-
Save believer/ec0ca4bfbd48d050899ef24fa07e2eae to your computer and use it in GitHub Desktop.
Defining color tokens in Nativewind 4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Default Tailwind styles */ | |
@tailwind base; | |
@tailwind components; | |
@tailwind utilities; | |
/* Light mode */ | |
:root { | |
--colors-on-container: #353531; | |
} | |
/* Dark mode */ | |
@media (prefers-color-scheme: dark) { | |
:root { | |
--colors-on-container: #cececa; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
content: [], | |
theme: { | |
colors: { | |
'on-container': 'var(--colors-on-container)', | |
}, | |
}, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Text } from 'react-native' | |
export function Typography () { | |
return ( | |
<Text className="text-on-container">Typography</Text> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment