'Is it possible to chain pseudo classes using Tailwind CSS?
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?
Solution 1:[1]
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.
Solution 2:[2]
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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Nicky J |
| Solution 2 | Hayyan Motsu |
