Replies: 1 comment 3 replies
-
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I use @emotion/css to work with vue. There is a priority issue between the class attribute automatically passed by the parent component and the internal class of the component.
Vue will pass attribute by default, see https://v3.vuejs.org/guide/component-attrs.html#attribute-inheritance. And emotion will insert a style immediately when it encounters a
css
function. Therefore, the style of the child component is always arranged behind and always overwrites the style specified by the parent component. What if I need the style specified by the parent component to have a higher priority?I can use the following ways to solve this problem. And is there any other solution to this problem? Thanks!
Parent.tsx
Child.tsx
If needed, there is a relevant code repository.
Beta Was this translation helpful? Give feedback.
All reactions