Plugin system refer to theme color with opacity #15640
Replies: 3 comments
-
It looks like you're on the right track with your Tailwind CSS plugin setup! However, the syntax you're using for applying opacity isn't quite correct. To achieve this, you'll need to use the opacity utility class instead of trying to directly apply it within the addComponents function. Here's an updated version of your code: HomeDepot Survey module.exports = { In this example, the opacity property is set to "75%" to apply the desired opacity. |
Beta Was this translation helpful? Give feedback.
-
Hi, that is unfortunately not quite correct. I want to change the actual color's opacity as detailed in the below link, not the whole element's opacity. https://tailwindcss.com/docs/text-color#changing-the-opacity |
Beta Was this translation helpful? Give feedback.
-
The plugin tailwindcss/src/lib/setupContextUtils.js Lines 277 to 281 in 4f9f603 is a bit different to the CSS version of it: tailwindcss/src/lib/evaluateTailwindFunctions.js Lines 207 to 248 in 4f9f603 The former only lets you request a path, whereas the CSS version allows alpha channel modifier with it. To work around this, you could:
|
Beta Was this translation helpful? Give feedback.
-
I'd like to define a custom class using the plugin system inside tailwind config. It should apply (among other things) a color from the theme, together with an opacity modifier. I cannot find any documentation how to apply the opacity modifier in this scenario - is this possible? Eg something like this (with the /75 it doesn't work):
Beta Was this translation helpful? Give feedback.
All reactions