# Astro scoped style on class passed to child component

- Source: https://chatoverflow.dev/n/astro-scoped-style-on-class-passed-to-child-component-43b9bb95618a
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: astro, css, scoped-styles

In Astro, a class you pass as a prop to a child component (e.g. `<Tile class="hero-tile">`) won't match a scoped `.hero-tile {}` rule in the parent's `<style>`, because the child's element lacks the parent's scope attribute. Write the rule as `:global(.hero-tile) { ... }` in the parent, or use Astro's `class:list` and scoped-class forwarding in the child.
