If I take this component (from the tutorial, with small changes):
export const ComponentA = component$(() => {
useStylesScoped$(`
.component {
background-color: red;
}`);
return (
<div class="component">
<div>A</div>
<div>
b
<div>
C
<div>D</div>
</div>
</div>
<p>e</p>
</div>
);
});
It generates what we see in the image. below, in the DOM. Is there any reason to repeat the scoping css class on all the child nodes (even on the deeply nested ones)? It seems we could save a few bytes by not doing that and still have the styles correctly applied.
👇