`xs: 0px` cannot be assigned as minimum breakpoint
Closed this issue · 6 comments
Hi guys !
In a NextJs project, I use your library for handling easily breakpoints (thanks by the way).
Unfortunately, this code below seems does not work since this following error has triggered :
Error: [styled-breakpoints]: 'xs: 0px' cannot be assigned as minimum breakpoint.
FYI, I use default breakpoint values.
export const Container = styled.div<WrapperProps>`
${space}
margin-left: auto;
margin-right: auto;
${between('xs', 'md')} {
width: 90%;
}
${up('md')} {
width: 70%;
}
`;
I remember a few months ago, this kind of code worked.
I use next 12.0.7 (which uses SWC instead of Babel now), styled-components 5.3.3 and styled-breakpoints 10.2.1.
Thanks for your help :-).
Hi, @fvandenbulck !) Just replace your code with this
export const Container = styled.div<WrapperProps>`
${space}
margin-left: auto;
margin-right: auto;
width: 90%;
${up('md')} {
width: 70%;
}
`;
@fvandenbulck If you have any questions, ask. I will gladly help you.
@fvandenbulck if you have any questions, ask. I will gladly help you.
Thanks @mg901, it works like that.
What was the issue exactly here ? xs
can not be used in between
function ?
@fvandenbulck when you create a layout from 0px, no breakpoints are needed. There is a need for them after (from sm
onwards).