Skip to content

Instantly share code, notes, and snippets.

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