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.

Use @material-ui/system in the core components

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

Expected Behavior 🤔

It will be super useful to have per-breakpoint align prop. E.g. alignSm, alignLg – them will add an ability to make responsive designs with no tears 😢

Current Behavior 😯

It is required to manually change text align for Typography Something like that:

alignCenterSm: {
  [theme.breakpoints.down('sm')]: {
    align: 'center'
  }
}

Examples 🌈

Smth similar is already implemented in vuetify -> https://vuetifyjs.com/ru/framework/alignment

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:11
  • Comments:16 (11 by maintainers)

github_iconTop GitHub Comments

14reactions
oliviertassinaricommented, Aug 3, 2019

@dmtrKovalenko The best solution, for now, is to do:

<Box textAlign={{ xs: 'left', md: 'center' }} clone>
  <Typography />
</Box>

The long term strategy is to find a way to have the core components host the system directly so we don’t have to use an extra Box + clone. So people can do:

<Typography textAlign={{ xs: 'left', md: 'center' }} />
4reactions
oliviertassinaricommented, Oct 20, 2019

and create a rabbit hole where we do this with all components eventually.

@yordis Yes, it’s the idea. There is a related opportunity we can explore. We could have a component that generates thousands of global class names, a là tailwind, that we could apply directly as class names. It would extend the system support to all elements on the page.

<button className="p-3" />
Read more comments on GitHub >

github_iconTop Results From Across the Web

Ready to use components, free forever - MUI Core
MUI Core. Ready to use components, free forever. Get a growing list of React components, ready-to-use, free forever, and with accessibility always in...
Read more >
Material UI - Overview - MUI
Material UI is an open-source React component library that implements Google's Material Design. It includes a comprehensive collection of prebuilt components ...
Read more >
MUI System - Overview
MUI System is a set of CSS utilities to help you build custom designs more efficiently when working with MUI component libraries like...
Read more >
Understanding MUI packages - Material UI
Material UI is a comprehensive library of components that features our implementation of Google's Material Design. @mui/system is included as dependency, ...
Read more >
Usage - MUI System
The following demo shows how to use the sx prop to apply custom styles and create a complex UI component using the Box...
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