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.

[RFC] Consider renaming xs breakpoint

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Summary šŸ’”

In order for the system to work well, it requires the first breakpoint to be 0px. This is required in order for the min-width media query logic to trigger correctly.

The use of xs to name this baseline might be wrong, evermore to allow developers to customize it.

Motivation šŸ”¦

The discussion started at https://github.com/mui/material-ui/pull/26135#discussion_r626396190. We noticed the current customization demo is wrong:

const theme = createMuiTheme({
  breakpoints: {
    values: {
      tablet: 640,
      laptop: 1024,
      desktop: 1280,
    },
  },
});

https://mui.com/material-ui/customization/breakpoints/#custom-breakpoints

It misses the mobile: 0 breakpoint.

Maybe it would make sense to remove xs from the theme and rename it differently, like _, or base.

Itā€™s also to be noted that xs is the anagram of sx, which can create confusion when reading it: #34948.


Another request from a user:

While using breakpoints object like this, How do we specify bgColor for devices less than xs?

<Box
    sx={{
      bgcolor: {
        xs: 'primary.light',
        sm: 'secondary.light',
      },
    }}
  />

Benchmarks

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:7
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
eps1loncommented, May 7, 2021

min adds ambiguity again in my opinion. If the value is 0 and will always be 0, Iā€™d just name it zero. Leaves no room for interpretation.

0reactions
oliviertassinaricommented, Jul 27, 2021

@eps1lon Ok, I think that we can take a step back. Do you think that we should implement #25846?

Maybe we will need it, eventually. If we donā€™t, then zero, min, base, _, I think that they could all potentially work.

I vote for using base over xs as the option that seems to work in most contexts.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MUI on Twitter: "@SujanTa88350485 @suraj_pheudin https://t.co ...
What if the mui default theme is customized for xs breakpoint to 0? I think it ... [RFC] Consider renaming xs breakpoint Ā·...
Read more >
DI 24510.006 - Assessing Residual Functional Capacity (RFC ...
This Ruling clarifies the term ā€œRFCā€ and discusses the elements considered in the assessment. It describes concepts for both physical andĀ ...
Read more >
Developers - [RFC] Material-UI v5 - - Bountysource
It's frustrating that only the Box component supports it. I think that it should also cover #6140. <Typography textAlign={{ xs: 'left', md: 'center'...
Read more >
TIBCO BusinessEventsĀ® Enterprise Edition Developers Guide
Renaming Moving Deleting and Copy-Pasting Elements ... Refactoring for Move and Rename Operations ... Setting Breakpoints in Rules and Rule Functions.
Read more >
Novell exteNd Composer
Pages, Java Naming and Directory Interface, JDK, JDBC, Java, HotJava, ... Support for the SAP Service type (triggering of Composer services via RFC...
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