While using Tailwind CSS along with the shadcn/ui library for styling buttons, I have encountered an unexpected behavior. The issue arises when trying to add background opacity to a custom color defined in globals.css
using HSL values such as:
--primary: 348, 76%, 64%;
The problem occurs when attempting to set the background opacity of a button using this custom color in shadcn/ui. For example:
<button class="hover:bg-primary/90">Button</button>
The goal is to create a button with a hover effect that adds 90% opacity to the background color defined as --primary. However, the opacity setting doesn't seem to have any effect, and the button maintains its original opacity.
Even though the custom color is correctly defined and available in the project's global styles, using Tailwind utility classes to apply opacity to it doesn't produce the desired outcome.