JedWatson / react-select

The Select Component for React.js
https://react-select.com/
MIT License
27.49k stars 4.12k forks source link

tailwind and react-select don't work #5703

Open MrOxMasTer opened 1 year ago

MrOxMasTer commented 1 year ago

Thanks for using react-select!

I tried classNamePrefix and className prop through the object, but it still doesn't work in any way. I tried to define classes in the global.css class Name Prefix file, for example a controller or something else, but the styles still didn't work. Maybe you can fix it? I tried on version @5 as well.7.4 and on @5.7.0, but still does not work

shanestreator commented 7 months ago

Is this a specificity issue? Below worked for me.

***** component *****

<Select
    value={selected}
    onChange={handleSelected}
    options={options}
    className='_select'
    classNamePrefix='_select'
/>

***** global.css *****

@layer components {
  ._select {
    @apply w-full;
  }
  ._select ._select__control {
    @apply bg-base-gray-900;
  }
}