Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Fix branding theme tabs and navigation bar regressions #37362

Merged
Next Next commit
Remove style overrides for MuiTab from branding theme and apply in Co…
…mponentPageTabs
  • Loading branch information
ZeeshanTamboli committed May 22, 2023
commit bdcd73326b5d79d4c0855efbd74f89eb665df94a
24 changes: 0 additions & 24 deletions docs/src/modules/brandingTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -741,30 +741,6 @@ export function getThemedComponents(): ThemeOptions {
defaultProps: {
disableTouchRipple: true,
},
styleOverrides: {
root: ({ theme }) => [
{
padding: theme.spacing(1),
marginBottom: theme.spacing(1),
marginRight: theme.spacing(1),
fontWeight: 600,
minHeight: 32,
minWidth: 0,
borderRadius: 12,
'&:hover': {
background: (theme.vars || theme).palette.grey[50],
},
},
theme.applyDarkStyles({
'&:hover': {
background: (theme.vars || theme).palette.primaryDark[700],
},
'&.Mui-selected': {
color: (theme.vars || theme).palette.primary[300],
},
}),
],
},
},
MuiPaper: {
styleOverrides: {
Expand Down
24 changes: 24 additions & 0 deletions docs/src/modules/components/ComponentPageTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,27 @@ import Link from 'docs/src/modules/components/Link';

export const HEIGHT = 50;

const tabSxProp = (theme) => ({
mnajdova marked this conversation as resolved.
Show resolved Hide resolved
padding: theme.spacing(1),
marginBottom: theme.spacing(1),
marginRight: theme.spacing(1),
fontWeight: 600,
minHeight: 32,
minWidth: 0,
borderRadius: '12px',
'&:hover': {
background: (theme.vars || theme).palette.grey[50],
},
...theme.applyDarkStyles({
'&:hover': {
background: (theme.vars || theme).palette.primaryDark[700],
},
'&.Mui-selected': {
color: (theme.vars || theme).palette.primary[300],
},
}),
});

export default function ComponentPageTabs(props) {
const {
activeTab,
Expand Down Expand Up @@ -67,6 +88,7 @@ export default function ComponentPageTabs(props) {
href={demosHref}
label={t('api-docs.demos')}
value=""
sx={tabSxProp}
/>
<Tab
component={Link}
Expand All @@ -75,6 +97,7 @@ export default function ComponentPageTabs(props) {
href={componentsHref}
label={t('api-docs.componentsApi')}
value="components-api"
sx={tabSxProp}
/>
{headers.hooks && headers.hooks.length > 0 && (
<Tab
Expand All @@ -84,6 +107,7 @@ export default function ComponentPageTabs(props) {
href={hooksHref}
label={t('api-docs.hooksApi')}
value="hooks-api"
sx={tabSxProp}
/>
)}
</Tabs>
Expand Down