Skip to content

Commit

Permalink
Add variants callback syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
brijeshb42 committed Jan 23, 2024
1 parent 662fb43 commit 38c417e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/zero-runtime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ npm install --save-dev @mui/zero-next-plugin
npm install --save-dev @mui/zero-vite-plugin
```


#### Next.js

In your `next.config.js` file,
Expand Down Expand Up @@ -47,7 +46,6 @@ Setting `sourceMap` to true will take you to the style definition in the JS file

#### Vite


In your vite config file,

1. Import the plugin
Expand Down Expand Up @@ -173,6 +171,16 @@ const Button = styled.button(() => ({
// Styles to be applied when <Button size="small" color="primary" />
},
},
{
// If key value pair doesn't suffice, you can use the callback syntax
// to return `true` if you want the styles to be applied
props({ children }) {
return !!children;
},
style: {
// CSS
},
},
],
}));
```
Expand Down

0 comments on commit 38c417e

Please sign in to comment.