Scoped Style - Root Element of Child component bahaviour #12580
ehassaan
started this conversation in
General Discussions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I understand it is by design that root element of the child component can be styled by the parent but I think this behavior should only exist when you explicitly use class argument on child component.
Consider a minimum example I shared below.
Current Behavior: Parent's root element styles being leaked to child's root element just because child component happened to be using the same root class name as parent (margin, padding and border leaked unintentionally, background-color purple leaked intentionally)
Expected Behavior: Parent's styles should be passed on to child's root only if the parent explicitly assigns a class to the child component and styles it using that class name. Someone should not be required to look at the source code of child component when working on parent just so they don't unintentionally leak the styles to child's root.
https://play.vuejs.org/#eNqdU8Fu1DAQ
Beta Was this translation helpful? Give feedback.
All reactions