Open kevinresol opened 4 years ago
I have a variant here that should be more complete (usage with or without theme), and also allows using css.Properties
enum values like Styles.jss(...)
does for withStyles
.
Example usage:
import mui.core.styles.MuiTheme;
import mui.core.styles.Styles;
private typedef TClasses = Classes<[fullHeight]>;
// ...
var styles:TClasses = Styles.makeStyles({
fullHeight: {
display: "flex",
position: Relative,
height: "100%",
"@media print": {
borderRadius: 0,
boxShadow: "none"
}
}
})();
console.dir(styles);
trace(styles.fullHeight);
var styles:TClasses = Styles.makeStyles(
(theme:DefaultTheme) -> Styles.jss({
fullHeight: {
color: theme.palette.text.primary
}
})
)(theme);
console.dir(styles);
trace(styles.fullHeight);
Does this work for your use case?
The macro helps typing the said function correctly.