Skip to content

Instantly share code, notes, and snippets.

@believer
Last active October 27, 2023 12:24
Show Gist options
  • Save believer/ec0ca4bfbd48d050899ef24fa07e2eae to your computer and use it in GitHub Desktop.
Save believer/ec0ca4bfbd48d050899ef24fa07e2eae to your computer and use it in GitHub Desktop.
Defining color tokens in Nativewind 4
/* 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;
}
}
module.exports = {
content: [],
theme: {
colors: {
'on-container': 'var(--colors-on-container)',
},
},
}
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