I'm currently need to integrate common components of a library into multiples websites. The component Library currently have a Global styles. That they inject in the following way:
<Global
styles={`
div {
padding: 0;
}
`}
/>
I want there "Global styles" only available for the components of this library. They are only on a part of the page.
So I've try this:
const Styles = styled.div`
div {
padding: 0;
}
`;
const Page = () => (
<Styles>
<SomeComponentsOfTheLibrary />
</Styles>
);
But it seems that everything in Styles
has the priority. Then if the component has padding: 10px;
it will take padding: 0;
of Styles
Here is the issue reproduced:
I know it's a css issue but I want to solve it with emotion
I've already saw: