Context: I am using postcss and tailwind bundled with webpack. I am trying to use a generic button module (styles in _btn.css) to use throughout a website I'm building. When I have the button inside a div with classes defined in another module (_hero.css), it recognizes the non hover btn styles. However, it doesn't respond to the hover pseudo class.
Problem: Below is a link to my GitHub repo:
https://github.com/mmelester/Janice-IntensiveHope-Website-Redo.git
The work is on the hero branch. Any help would be greatly appreciated. The html code is in src/index.html. The main css file is in src/styles/global/style.css. The 2 additional supporting css files are in src/styles/module/_hero.css and /_btn.css.
I tried using !Important in case it was a specificity issue. I tried putting the same hover style into the _hero.css file. I consulted with GPT, but everything it suggested I was already doing. If I use the btn class outside of the div (with styles defined in _hero.css), it works fine.
The hover style was to change the opacity of the background button. The second btn instance works as expected.
The
.hero__hero-image--hero-overlayelement is overlapping all the elements, preventing any mouse interaction with the elements underneath. You could consider settingpointer-events: noneon this element so that elements underneath can be interacted with by the mouse and thus show the hover styling: