emortlock / tailwind-react-ui

React utility component primitives & UI framework for use with Tailwind CSS
https://emortlock.github.io/tailwind-react-ui/
274 stars 36 forks source link

Background Colors not pulling through #107

Open TylerOlthuizen opened 4 years ago

TylerOlthuizen commented 4 years ago

This may be an issue with my tailwind setup , not 100% sure.

I'm using the fill button component that is in the docs example.

const Button = () => <FillButton brand="primary">Submit</FillButton>

Screen Shot 2020-09-20 at 3 54 46 PM

some styles pull in , others do not such as the background color.

here is my tailwind config

const plugins = require('tailwind-react-ui/plugins')
module.exports = {
  // ...project config
  purge: [

  ],
  plugins: [
    require('tailwindcss/lib/plugins/container')({}),
    ...Object.keys(plugins).map(name => plugins[name]()),
  ],
}

here is my postcss config

module.exports = {
    plugins: [
        require('tailwindcss'),
        require('autoprefixer'),
    ],
};

:)
dzaman commented 3 years ago

The issue is that tailwind-react-ui expects Tailwind 1 and the color naming convention changed in Tailwind 2. The colors in this library use <target>-<color>-<label> (e.g. bg-red-darker) and in Tailwind 2, the label has been replaced with a number.

You can work around this to some extent using a theme.