Home > other >  Is it possible to chain pseudo classes using Tailwind CSS?
Is it possible to chain pseudo classes using Tailwind CSS?

Time:01-26

I have an after: pseudo element I'm targetting using Tailwind CSS. I want to remove the background of the element when moving up to medium screens.

I know I should be able to do md:bg-none AND I can do after:bg-none, but can I do them together?

e.g. md:after:bg-none

Should this work? Or am I missing something?

CodePudding user response:

I don't think you need both of them, if one of them works then it should be more than enough to meet your needs.

md: bg-none

CodePudding user response:

Never mind! I realised I must have overwritten the Tailwind defaults somehow and bg-none wasn't working.

I added bg-none to the taiwind.config file and I was able to run:

md:after:bg-none

So for anyone else wandering (because there didn't seem to be any other answers elsewhere, it is perfectly possible to chain pseudo-classes together using Tailwind CSS.

  •  Tags:  
  • Related