tailwind-react-native-classnames icon indicating copy to clipboard operation
tailwind-react-native-classnames copied to clipboard

Colors not working with config file

Open I-Kovalov opened this issue 9 months ago • 1 comments

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

I-Kovalov avatar Apr 29 '25 13:04 I-Kovalov

Remove your 'presets' from the config

mhmdiqbal avatar Jun 08 '25 08:06 mhmdiqbal