Hey, I'm trying to style components from the parent. I did a quick search in the discord and found the :global selector.
It works, but is that really the only way to go about it? It's not a bad solution it just seems a bit unintuitive to me. Maybe someone can help explain why it's happening like this.
Here's the code:
<section id="cta">
<!-- MaxWidthContainer is just a section with a slot -->
<MaxWidthContainer>
<h2>Check out my Etsy</h2>
<a href="/">Etsy Shop</a>
</MaxWidthContainer>
</section>
section {
margin: t.$m-section;
:global(.max-width) {
background-color: t.$clr-brand-muted;
padding: 4rem 1rem;
text-align: center;
@media (min-width: t.$bp-tablet) {
padding: 4rem;
}
}
}