question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`xs: 0px` cannot be assigned as minimum breakpoint

See original GitHub issue

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 😃.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
fbnvdblckcommented, Dec 27, 2021

@mg901 You’re right. So, it’s why sm is explicitly forbidden in this case. Thanks for your answer 😉.

1reaction
mg901commented, Dec 27, 2021

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%;
  }
`;
Read more comments on GitHub >

github_iconTop Results From Across the Web

custom breakpoint xs fails if min-width: 0px not specified #1050
when screen is smaller than max-width: 599.99px, media observer should next() xs. What is the current behavior? The changes array has LT-SM LT- ......
Read more >
styled-breakpoints - npm
Simple and powerfull css breakpoints for styled-components and emotion. Latest version: 11.1.1, last published: 6 months ago.
Read more >
How to Use CSS Breakpoints in Material UI - Level Up Coding
This will check if the breakpoint has a minimum width of 600px. If it matches, meaning if the screen is at least 600px...
Read more >
CSS · Bootstrap
Grid classes apply to devices with screen widths greater than or equal to the breakpoint sizes, and override grid classes targeted at smaller...
Read more >
Media queries in MUI components - reactjs - Stack Overflow
You can see MUI default breakpoints here. The breakpoint names and values can be overrided using createTheme() : const theme = createTheme({ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found