Skip to content

Colors not working with config file #341

@I-Kovalov

Description

@I-Kovalov
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions