Skip to content

Commit

Permalink
make menu styles consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
danilo-leal committed May 24, 2024
1 parent a3fdc9f commit 9019ca1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ export default function ToggleDisplayOption(props: ToggleDisplayOptionProps) {
data-ga-event-action={sectionType}
data-ga-event-label="table"
>
Table
<CheckIcon
sx={{ fontSize: '0.85rem', mr: 1, opacity: displayOption === 'table' ? 1 : 0 }}
sx={{ fontSize: '0.85rem', ml: 'auto', opacity: displayOption === 'table' ? 1 : 0 }}
/>
Table
</MenuItem>
<MenuItem
value="expanded"
Expand All @@ -148,10 +148,10 @@ export default function ToggleDisplayOption(props: ToggleDisplayOptionProps) {
data-ga-event-action={sectionType}
data-ga-event-label="expanded"
>
Expanded list
<CheckIcon
sx={{ fontSize: '0.85rem', mr: 1, opacity: displayOption === 'expanded' ? 1 : 0 }}
sx={{ fontSize: '0.85rem', ml: 'auto', opacity: displayOption === 'expanded' ? 1 : 0 }}
/>
Expanded list
</MenuItem>
<MenuItem
value="collapsed"
Expand All @@ -161,10 +161,10 @@ export default function ToggleDisplayOption(props: ToggleDisplayOptionProps) {
data-ga-event-action={sectionType}
data-ga-event-label="collapsed"
>
Collapsed list
<CheckIcon
sx={{ fontSize: '0.85rem', mr: 1, opacity: displayOption === 'collapsed' ? 1 : 0 }}
sx={{ fontSize: '0.85rem', ml: 'auto', opacity: displayOption === 'collapsed' ? 1 : 0 }}
/>
Collapsed list
</MenuItem>
</Menu>
</React.Fragment>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/AppNavDrawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ export default function AppNavDrawer(props) {
{versions.map((item) => {
if (item.text === 'View all versions') {
return [
<Divider key="divider" sx={{ mx: -1 }} />,
<Divider key="divider" />,
<MenuItem key="all-versions" component="a" href={item.href} onClick={onClose}>
{/* eslint-disable-next-line material-ui/no-hardcoded-labels -- version string is untranslatable */}
{`View all versions`}
Expand Down
15 changes: 10 additions & 5 deletions packages/mui-docs/src/branding/brandingTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ export function getThemedComponents(): ThemeOptions {
color: (theme.vars || theme).palette.text.primary,
backgroundColor: alpha(theme.palette.primaryDark[50], 0.1),
borderColor: (theme.vars || theme).palette.primaryDark[100],
boxShadow: `${alpha(theme.palette.grey[200], 0.5)} 0 1px 0 inset, ${alpha(theme.palette.grey[100], 0.4)} 0 -1px 0 inset, ${alpha(theme.palette.grey[200], 0.5)} 0 1px 2px 0`,
boxShadow: `#FFF 0 1px 0 inset, ${alpha(theme.palette.grey[200], 0.4)} 0 -1px 0 inset, ${alpha(theme.palette.grey[200], 0.5)} 0 1px 2px 0`,
'&:hover': {
backgroundColor: (theme.vars || theme).palette.grey[50],
},
Expand Down Expand Up @@ -801,6 +801,14 @@ export function getThemedComponents(): ThemeOptions {
border: '1px solid',
backgroundColor: (theme.vars || theme).palette.background.paper,
borderColor: (theme.vars || theme).palette.grey[200],
'& .MuiMenu-list': {
display: 'flex',
flexDirection: 'column',
gap: '2px',
'& .MuiDivider-root': {
margin: '4px -8px 4px -8px',
},
},
'& .MuiMenuItem-root': {
padding: '6px 12px',
borderRadius: '6px',
Expand Down Expand Up @@ -849,10 +857,7 @@ export function getThemedComponents(): ThemeOptions {
MuiDivider: {
styleOverrides: {
root: ({ theme }) => ({
borderColor: (theme.vars || theme).palette.grey[100],
...theme.applyDarkStyles({
borderColor: alpha(theme.palette.primaryDark[500], 0.3),
}),
borderColor: (theme.vars || theme).palette.divider,
}),
},
},
Expand Down

0 comments on commit 9019ca1

Please sign in to comment.