Utilizing the ToggleButton
and ToggleButtonGroup
components from material-ui
, starting with material-ui's gatsby template. To prevent common material-ui
errors with production builds, I am attempting to incorporate styled-components
as well.
The following react code is having trouble targeting the material ui base button correctly.
- What is the correct way to achieve this using styled-components?
- Am I overlooking any best practices?
(I understand that material ui may have specific guidelines on layout, but suppose I wanted to customize the hover or text color of the base element).
// Also imports React, gatsby packages etc
import ToggleButton from '@material-ui/lab/ToggleButton';
import ToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup';
import styled from 'styled-components';
const StyledToggleButton = styled(ToggleButton)`
color: black;
${'' /* Not focusing too much on this section */}
& .MuiButtonBase{
color: pink;
border-radius: 10em;
${'' /* THIS IS WHERE I WANT TO AFFECT THE BASE BUTTONS! NOT SURE IF .MuiButtonBase IS CORRECT!*/}
}
`;