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
Merged
4 changes: 2 additions & 2 deletions docs/src/createEmotionCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ function globalSelector(element: Element) {
switch (element.type) {
case RULESET:
element.props = (element.props as string[]).map((value: any) => {
if (value.match(/(:where|:is)\(/)) {
value = value.replace(/\.[^:]+(:where|:is)/, '$1');
if (value.match(/(:where|:has)\(/)) {
value = value.replace(/\.[^:]+(:where|:has)/, '$1');
oliviertassinari marked this conversation as resolved.
Show resolved Hide resolved
ZeeshanTamboli marked this conversation as resolved.
Show resolved Hide resolved
return value;
}
return value;
Expand Down
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
28 changes: 25 additions & 3 deletions docs/src/modules/components/ComponentPageTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,35 @@ import * as React from 'react';
import PropTypes from 'prop-types';
import { useRouter } from 'next/router';
import { useTranslate } from 'docs/src/modules/utils/i18n';
import { styled } from '@mui/material/styles';
import Box from '@mui/material/Box';
import Tabs, { tabsClasses } from '@mui/material/Tabs';
import Tab, { tabClasses } from '@mui/material/Tab';
import Link from 'docs/src/modules/components/Link';

export const HEIGHT = 50;

const StyledTab = styled(Tab)(({ theme }) => ({
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 @@ -60,15 +82,15 @@ export default function ComponentPageTabs(props) {
},
}}
>
<Tab
<StyledTab
component={Link}
shallow
scroll
href={demosHref}
label={t('api-docs.demos')}
value=""
/>
<Tab
<StyledTab
component={Link}
shallow
scroll
Expand All @@ -77,7 +99,7 @@ export default function ComponentPageTabs(props) {
value="components-api"
/>
{headers.hooks && headers.hooks.length > 0 && (
<Tab
<StyledTab
component={Link}
shallow
scroll
Expand Down