Below is a very simple example to demonstrate the issue.
All paragraph elements are styled red, but then the content generated by ::after
should not be red anymore. Its color should be unset.
Why doesn't this work?
<!DOCTYPE html>
<html>
<head>
<style>
p {color:red}
p::after {
content: " and after";
color: unset;
}
</style>
</head>
<body>
<p>before</p>
</body>
</html>
With a property like color
, at least a different value can be manually specified. But I've run into a case where I want to use filter: brightness(1.2)
on an element but not allow that filter to affect the ::after
content.