Skip to content

Instantly share code, notes, and snippets.

@keremistan
Created March 18, 2021 08:47
Show Gist options
  • Save keremistan/518258c42c33b59bb0d8386c63bc3c0d to your computer and use it in GitHub Desktop.
Save keremistan/518258c42c33b59bb0d8386c63bc3c0d to your computer and use it in GitHub Desktop.
A sample where fixed positioning is used.
const useStyles = makeStyles({
fixedToPageWrapper: {
position: 'relative',
'&__rightButton': {
position: 'fixed',
right: 0,
},
'&__leftButton': {
position: 'fixed',
left: 0,
},
},
}, {name: 'MuiBlogPost'});
export function SliderButtonsBlogPost() {
const classes = useStyles();
return (
<section className={classes.buttonSamplesWrapper}>
<h1>Fixed Positions</h1>
<div className={`${classes.fixedToPageWrapper} ${classes.sampleWrapper}`}>
<LeftSliderButton className={`${classes.fixedToPageWrapper}__leftButton`} />
{get10RandomColors().map(color => <Color colorName={color} />)}
<RightSliderButton className={`${classes.fixedToPageWrapper}__rightButton`} />
</div>
</section>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment