Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[system] Support style.transform return React.CSSProperties #18030

Merged
merged 1 commit into from Oct 27, 2019

Conversation

yoyooyooo
Copy link
Contributor

transform should support map one to many css

import { style } from '@material-ui/system';

export default style({
  prop: 'flexCenter',
  cssProperty: false,
  transform: flexCenter => {
    return flexCenter
      ? {
          display: 'flex',
          justifyContent: 'center',
          alignItems: 'center',
        }
      : {};
  },
});

use :

<Box flexCenter>center</Box>

@mui-pr-bot
Copy link

No bundle size changes comparing cec2f0c...d293f10

Generated by 🚫 dangerJS against d293f10

@oliviertassinari oliviertassinari changed the title [system] suport style.transform return React.CSSProperties [system] Support style.transform return React.CSSProperties Oct 25, 2019
@oliviertassinari
Copy link
Member

oliviertassinari commented Oct 27, 2019

@yoyooyooo Nice one:

<Box flexCenter>center</Box>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: system Specific to @mui/system typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants