tailwind-react-native-classnames
tailwind-react-native-classnames copied to clipboard
Colors not working with config file
import tw from "@/libs/tailwind";
export const CustomText = ({
fontStyle,
size,
className,
...props
}: CustomTextProps) => {
console.log(tw.color("success"));
return (
<Text
{...props}
style={tw.style(
"text-success"
)}
/>
);
};
> (NOBRIDGE) LOG #008000
> (NOBRIDGE) WARN `success` unknown or invalid utility [Component Stack]
// /libs/tailwind.ts
import { create } from "twrnc";
const tw = create(require("../tailwind.config"));
export default tw;
// tailwind.config.js
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./app/**/*.{js,jsx,ts,tsx}", "./components/**/*.{js,jsx,ts,tsx}"],
presets: [],
darkMode: "class",
theme: {
extend: {
colors: {
background: "#131313",
surface: "#1A1A1A",
"primary-accent": "#9476F4",
danger: "#FA5757",
primary: "#D6D6D6",
secondary: "#A5A5A5",
tertiary: "#717171",
success: "#008000",
},
},
},
plugins: [],
};
Tried everything even used versions from my old project where everything works. Has someone faced this bug? Font sizes, etc works as expected
Remove your 'presets' from the config