Skip to content

Instantly share code, notes, and snippets.

@montogeek
Created September 11, 2020 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save montogeek/6351c123150fca46cce81022841ec344 to your computer and use it in GitHub Desktop.
Save montogeek/6351c123150fca46cce81022841ec344 to your computer and use it in GitHub Desktop.
React MaterialUIHueOverlay
const useOverlayStyles = makeStyles((theme) => {
return {
blended: {
mixBlendMode: 'hue',
backgroundColor: theme.palette.primary.main,
position: 'absolute',
top: -4, // To include the border
right: 0,
bottom: 0,
left: 0,
content: ' ',
zIndex: theme.zIndex.tooltip,
},
};
});
export function ThemeOverlay() {
const classes = useOverlayStyles();
const theme = useTheme();
if (theme.name !== 'Caspar') {
return <Box className={classes.blended} />;
}
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment