I am currently utilizing style-loader
and css-loader
for importing stylesheets in a react project:
require('../css/gallery/style.css');
Everything in the stylesheet is working smoothly, except for one specific rule:
.grid::after {
content: '';
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
}
There is already a div
with the grid
class in my code:
<div className="grid">
{display_images}
</div>
The element that should be created by the :after
pseudoclass is not appearing as expected. It's known that React doesn't support pseudoclasses in inline styles, but is there a way to utilize them in external stylesheets and then import them? If not, what are the alternative solutions?