I am tring to style the options on hover but it doesn’t seem to respond by all means
I tried doing it both nativly and with tailwind
code –> https://play.tailwindcss.com/xzKArHLPZE
context:
- I want to style this select as I’m using it in react-day-picker.
- I have to select the "option" as a decendent as I am restricted by react-day-picker
- solving it with tailwind is preferable as I don’t want to polute my global.css file too much
thanks in advance
2
Answers
Here’s a simple example of how you can apply styles using Tailwind CSS
Select an option:
I think you will need some JavaScript for this to work.
I added three inline-JS event listeners to modify the
size
of the<select>
element.This solution will only change the background of the currently-hovered
<option>
.Here is the reference solution that I applied: