First of all, I'm sorry if there is already a similar question that I ask, but it is not that easy to search for that specific case.
What I want to achieve, is coloring every "a" element, except those that are wrapped in a header element h1,h2,h3,h4,h5.
I'm aware of the parent selector, but I don't want to apply anything to the parent, but the child element I create the CSS rule for.
What I came up with so far was this:
a {
& {
background-color: yellow;
}
&:not(h1, h2, h3, h4, h5, h6) {
@apply text-blue-600 break-words;
& :hover {
@apply text-blue-700;
}
}
}
It seems to have no effect and applies the style to all "a" tags still, and the yellow background is applied to the "a" tag as well, which is the current element, not to the parent element, which is opposing to what I understood from the docs.
How do I create a correct selector based on what the parent of my "a" element is?