Skip to content

Commit 4561535

Browse files
[docs] Fix branding theme tabs and navigation bar regressions (#37362)
1 parent d5e8321 commit 4561535

File tree

2 files changed

+27
-29
lines changed

2 files changed

+27
-29
lines changed

docs/src/modules/brandingTheme.ts

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -741,30 +741,6 @@ export function getThemedComponents(): ThemeOptions {
741741
defaultProps: {
742742
disableTouchRipple: true,
743743
},
744-
styleOverrides: {
745-
root: ({ theme }) => [
746-
{
747-
padding: theme.spacing(1),
748-
marginBottom: theme.spacing(1),
749-
marginRight: theme.spacing(1),
750-
fontWeight: 600,
751-
minHeight: 32,
752-
minWidth: 0,
753-
borderRadius: 12,
754-
'&:hover': {
755-
background: (theme.vars || theme).palette.grey[50],
756-
},
757-
},
758-
theme.applyDarkStyles({
759-
'&:hover': {
760-
background: (theme.vars || theme).palette.primaryDark[700],
761-
},
762-
'&.Mui-selected': {
763-
color: (theme.vars || theme).palette.primary[300],
764-
},
765-
}),
766-
],
767-
},
768744
},
769745
MuiPaper: {
770746
styleOverrides: {
@@ -778,7 +754,7 @@ export function getThemedComponents(): ThemeOptions {
778754
...(ownerState.variant === 'outlined' && {
779755
display: 'block',
780756
borderColor: (theme.vars || theme).palette.grey[200],
781-
':is(a, button)': {
757+
':is(a&), :is(button&)': {
782758
'&:hover': {
783759
boxShadow: `0px 4px 20px rgba(170, 180, 190, 0.3)`,
784760
},
@@ -790,7 +766,7 @@ export function getThemedComponents(): ThemeOptions {
790766
...(ownerState.variant === 'outlined' && {
791767
borderColor: (theme.vars || theme).palette.primaryDark[500],
792768
backgroundColor: (theme.vars || theme).palette.primaryDark[700],
793-
':is(a, button)': {
769+
':is(a&), :is(button&)': {
794770
'&:hover': {
795771
boxShadow: `0px 4px 20px rgba(0, 0, 0, 0.5)`,
796772
},

docs/src/modules/components/ComponentPageTabs.js

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,35 @@ import * as React from 'react';
22
import PropTypes from 'prop-types';
33
import { useRouter } from 'next/router';
44
import { useTranslate } from 'docs/src/modules/utils/i18n';
5+
import { styled } from '@mui/material/styles';
56
import Box from '@mui/material/Box';
67
import Tabs, { tabsClasses } from '@mui/material/Tabs';
78
import Tab, { tabClasses } from '@mui/material/Tab';
89
import Link from 'docs/src/modules/components/Link';
910

1011
export const HEIGHT = 50;
1112

13+
const StyledTab = styled(Tab)(({ theme }) => ({
14+
padding: theme.spacing(1),
15+
marginBottom: theme.spacing(1),
16+
marginRight: theme.spacing(1),
17+
fontWeight: 600,
18+
minHeight: 32,
19+
minWidth: 0,
20+
borderRadius: '12px',
21+
'&:hover': {
22+
background: (theme.vars || theme).palette.grey[50],
23+
},
24+
...theme.applyDarkStyles({
25+
'&:hover': {
26+
background: (theme.vars || theme).palette.primaryDark[700],
27+
},
28+
'&.Mui-selected': {
29+
color: (theme.vars || theme).palette.primary[300],
30+
},
31+
}),
32+
}));
33+
1234
export default function ComponentPageTabs(props) {
1335
const {
1436
activeTab,
@@ -60,15 +82,15 @@ export default function ComponentPageTabs(props) {
6082
},
6183
}}
6284
>
63-
<Tab
85+
<StyledTab
6486
component={Link}
6587
shallow
6688
scroll
6789
href={demosHref}
6890
label={t('api-docs.demos')}
6991
value=""
7092
/>
71-
<Tab
93+
<StyledTab
7294
component={Link}
7395
shallow
7496
scroll
@@ -77,7 +99,7 @@ export default function ComponentPageTabs(props) {
7799
value="components-api"
78100
/>
79101
{headers.hooks && headers.hooks.length > 0 && (
80-
<Tab
102+
<StyledTab
81103
component={Link}
82104
shallow
83105
scroll

0 commit comments

Comments
 (0)