Skip to content

[system] Allow max-width breakpoint instead of min-width #25846

@ifndefdeadmau5

Description

@ifndefdeadmau5

Summary 💡

For now, responsive values only behaves as we're using breakpoints.up('xx'), and there's no way around to make it behaves like breakpoints.down('xx'). Providing a way to change this would be useful to some developers trying to add responsiveness to their app from larger screen resolution to smaller screen resolution.

Examples 🌈

/*
 * Below works same as `theme.breakpoints.up(key)`, hence previously defined padding is overriden
 */
<Paper sx={{ padding: { xs: 0 } }}>
  This box has a responsive width.
</Paper>
/*
 * So we need to add default style value to prevent overriding
 */
<Paper sx={{ padding: { xs: 0, md: 8 } }}>
  This box has a responsive width.
</Paper>

Motivation 🔦

We're adding responsive(mobile) UI to desktop oriented design, and we found that we need to specify original style property value(if it has one) when using sx prop's responsive values in material UI components(other than <Box />)

User requests

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: systemThe system, the design tokens / styling foundations used across components. eg. @mui/system with MUItype: new featureExpand the scope of the product to solve a new problem.waiting for 👍Waiting for upvotes. Open for community feedback and needs more interest to be worked on.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions