CSS classes in component scoped styles are overriding child classes of the same name in their own scoped styles
Vue version
3.2.37
Link to minimal reproduction
Steps to reproduce
A parent component and child component have the same css class name within their own scoped styles.
What is expected?
CSS classes defined in component scoped style should not affect their children even the child uses the same class name in its own scoped styles.
What is actually happening?
CSS classes in parent component scoped styles are available in immediate child components and will override child components own scoped style.
System Info
No response
Any additional comments?
In the SFC example I have 3 components (Comp1-3) which all have the scoped style and the same class name. You can observe that Comp1 css affects immediate child (Comp2) while the Comp2 affects immediate child (Comp3). If the components are outside of their affecting parent then its style is correct.
This is documented behaviour and has been since Vue 2.
https://vuejs.org/api/sfc-css-features.html#child-component-root-elements