I'm using GatsbyJS with TailwindCSS, When i tried passing tailwind styles into the wrapper of StaticImage from gatsby-image-plugin, the existing styles are not getting overridden (ie. gatsby-image-wrapper and gatsby-image-wrapper-constrained style).
<StaticImage src="https://images.pexels.com/photos/189349/pexels-photo-189349.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940" alt="just an image" placeholder="blurred" className="absolute z-0" objectFit="cover" />
The position for the wrapper remains the same (gatsby-image-wrapper & gatsby-image-wrapper-constrained), while some of the classes passed into the component are ignored.
Is there any way to remove the default styles, or any other method to get the classes passed to work?
1.installing the dependencies 2. Generating the config files 3. Importing the files into global.css tailwind base; tailwind components; tailwind utilities;
– Airliah!important
in your tailwind config? tailwindcss.com/docs/configuration#important – Fascism!important
as per the tailwind config, it doesn't override the StaticImage wrapper classes, also it breaks the entire design. Tried the important: "#id" on tailwind.config approach, and passed the ID into the StaticImage component. – Airliah!important
, sorry. – Subzero