Skip to content

Commit

Permalink
improve show code button affordance
Browse files Browse the repository at this point in the history
  • Loading branch information
danilo-leal committed Sep 5, 2023
1 parent 95a9ebc commit 0e4c253
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions docs/src/modules/components/DemoToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,34 @@ const ToggleButtonGroup = styled(MDToggleButtonGroup)(({ theme }) => [

const Button = styled(MDButton)(({ theme }) => ({
height: 24,
padding: '5px 8px 6px 8px', // the one-off 5px is for visually centering the text on the button's container
flexShrink: 0,
borderRadius: 999,
border: 'none',
border: '1px solid',
borderColor: alpha(theme.palette.primary[100], 0.6),
fontSize: theme.typography.pxToRem(13),
fontWeight: theme.typography.fontWeightMedium,
color: theme.palette.text.secondary,
color: theme.palette.primary.main,
'& .MuiSvgIcon-root': {
color: theme.palette.primary.main,
},
'&:hover': {
backgroundColor: theme.palette.grey[50],
backgroundColor: theme.palette.primary[50],
borderColor: theme.palette.primary[200],
// Reset on touch devices, it doesn't add specificity
'@media (hover: none)': {
backgroundColor: 'transparent',
},
},
...theme.applyDarkStyles({
color: theme.palette.primary[300],
borderColor: alpha(theme.palette.primary[300], 0.2),
'& .MuiSvgIcon-root': {
color: theme.palette.primary[300],
},
'&:hover': {
backgroundColor: theme.palette.primaryDark[700],
borderColor: alpha(theme.palette.primary[300], 0.5),
backgroundColor: alpha(theme.palette.primary[500], 0.2),
// Reset on touch devices, it doesn't add specificity
'@media (hover: none)': {
backgroundColor: 'transparent',
Expand Down Expand Up @@ -531,6 +543,7 @@ export default function DemoToolbar(props) {
data-ga-event-action="expand"
onClick={onCodeOpenChange}
{...getControlProps(3)}
sx={{ mr: 0.5 }}
>
{showCodeLabel}
</Button>
Expand Down

0 comments on commit 0e4c253

Please sign in to comment.