jaredh159 / tailwind-react-native-classnames

simple, expressive API for tailwindcss + react-native
2.08k stars 84 forks source link

Custom config throwing warning "unknown or invalid utility" #232

Closed oktalk closed 1 year ago

oktalk commented 1 year ago

My custom utilities are not working, and throwing errors like: unknown or invalid utility

Here is my setup:

// tailwind.js
import { create } from 'twrnc';
const tw = create(require('../../tailwind.config.js'));
export default tw;
// tailwind.config.js
module.exports = {
  content: ["*.{js,jsx,ts,tsx}", "./src/**/*.{js,jsx,ts,tsx}"],
  theme: {
    extend: {
      color: {
        crimson: "#DC1E37",
      },
    },
  },
  plugins: [],
}

And here is how I'm using it: tw.style('font-bold text-crimson')}

All default tailwind classes work. Only my custom classes throw errors. Any ideas on how to get custom classes working are welcome.

jaredh159 commented 1 year ago

i think you need to use the key colors instead of color. can you try that?

oktalk commented 1 year ago

:face_palm_emoji

@jaredh159 Thank you. Ouch, I feel silly not catching that.

jaredh159 commented 1 year ago

no problem, happens to all of us :)