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-infra] Add spacing and contrast improvements #41191

Merged
merged 14 commits into from
Feb 21, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
244 changes: 113 additions & 131 deletions docs/src/modules/components/DiamondSponsors.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import Box from '@mui/material/Box';
import Stack from '@mui/material/Stack';
import Button from '@mui/material/Button';
import Typography from '@mui/material/Typography';
import DiamondOutlinedIcon from '@mui/icons-material/DiamondOutlined';
import { useTranslate } from 'docs/src/modules/utils/i18n';
import Link from 'docs/src/modules/components/Link';
import { useTranslate } from 'docs/src/modules/utils/i18n';

const NativeLink = styled('a')(({ theme }) => ({
boxSizing: 'border-box', // TODO have CssBaseline in the Next.js layout
Expand All @@ -26,6 +25,10 @@ const NativeLink = styled('a')(({ theme }) => ({
'&:hover': {
backgroundColor: (theme.vars || theme).palette.grey[50],
},
'&:focus-visible': {
outline: `3px solid ${alpha((theme.vars || theme).palette.primary[500], 0.5)}`,
outlineOffset: '2px',
},
'& img': {
display: 'inline-block',
},
Expand All @@ -45,146 +48,125 @@ export default function DiamondSponsors() {

return (
<Stack
spacing={0.5}
spacing={1}
useFlexGap
direction="column"
sx={{
mt: 1.5,
pt: 1.5,
mt: 2,
pt: 2,
borderTop: '1px solid',
borderColor: 'divider',
}}
>
<Button
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels a bit weird to have nothing do show a distinction between the nav and sponsors. And the explaination about what are those logo can only be inferred from the "Become a Diamond sponsor" after them.

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I felt like having both the "Become a Diamond Sponsor" and "Diamond Sponsor" buttons was redundant, particularly as they were taking to, essentially, the same place. I experimented with adding a "Sponsors" nav label, sort of similar to the "Contents" on the top of the TOC, but felt like visitors would be able to understand what these logos are even without a label?

component="a"
href="/material-ui/discover-more/backers/"
<NativeLink
data-ga-event-category="sponsor"
data-ga-event-action="docs-premium"
data-ga-event-label="octopus.com"
href="https://octopus.com/?utm_source=materialui&utm_medium=referral"
rel="noopener sponsored"
target="_blank"
>
<Box
component="img"
height="25px"
width="116px"
src="/static/sponsors/octopus-light.svg"
alt="octopus"
title="Repeatable, reliable deployments"
loading="lazy"
sx={(theme) =>
theme.applyDarkStyles({
content: `url(/static/sponsors/octopus-dark.svg)`,
})
}
/>
</NativeLink>
<NativeLink
data-ga-event-category="sponsor"
data-ga-event-action="docs-premium"
data-ga-event-label="doit.com"
href="https://www.doit.com/flexsave/?utm_source=materialui&utm_medium=referral"
rel="noopener sponsored"
target="_blank"
>
<Box
component="img"
height="29px"
width="70px"
src="/static/sponsors/doit-light.svg"
alt="doit"
title="Management Platform for Google Cloud and AWS"
loading="lazy"
sx={(theme) =>
theme.applyDarkStyles({
content: `url(/static/sponsors/doit-dark.svg)`,
})
}
/>
</NativeLink>
<NativeLink
data-ga-event-category="sponsor"
data-ga-event-action="docs-premium"
data-ga-event-label="marblism.com"
href="https://www.marblism.com/?utm_source=mui"
rel="noopener sponsored"
target="_blank"
rel="noopener nofollow"
size="small"
startIcon={<DiamondOutlinedIcon />}
sx={{
width: 'fit-content',
fontSize: (theme) => theme.typography.pxToRem(12.5),
'& svg': {
marginRight: 0.5,
width: 16,
height: 16,
},
}}
>
{t('diamondSponsors')}
</Button>
<Stack spacing={1}>
<NativeLink
data-ga-event-category="sponsor"
data-ga-event-action="docs-premium"
data-ga-event-label="octopus.com"
href="https://octopus.com/?utm_source=materialui&utm_medium=referral"
rel="noopener sponsored"
target="_blank"
>
<Box
component="img"
height="25px"
width="116px"
src="/static/sponsors/octopus-light.svg"
alt="octopus"
title="Repeatable, reliable deployments"
loading="lazy"
sx={(theme) =>
theme.applyDarkStyles({
content: `url(/static/sponsors/octopus-dark.svg)`,
})
}
/>
</NativeLink>
<NativeLink
data-ga-event-category="sponsor"
data-ga-event-action="docs-premium"
data-ga-event-label="doit.com"
href="https://www.doit.com/flexsave/?utm_source=materialui&utm_medium=referral"
rel="noopener sponsored"
target="_blank"
>
<Box
component="img"
height="29px"
width="70px"
src="/static/sponsors/doit-light.svg"
alt="doit"
title="Management Platform for Google Cloud and AWS"
loading="lazy"
sx={(theme) =>
theme.applyDarkStyles({
content: `url(/static/sponsors/doit-dark.svg)`,
})
}
/>
</NativeLink>
<NativeLink
data-ga-event-category="sponsor"
data-ga-event-action="docs-premium"
data-ga-event-label="marblism.com"
href="https://www.marblism.com/?utm_source=mui"
rel="noopener sponsored"
target="_blank"
>
<Box
component="img"
height="27px"
width="90px"
src="/static/sponsors/marblism-light.svg"
alt="marblism"
title="AI web app generation"
loading="lazy"
sx={(theme) =>
theme.applyDarkStyles({
content: `url(/static/sponsors/marblism-dark.svg)`,
})
}
/>
</NativeLink>
<Link
href="/material-ui/discover-more/backers/#diamond-sponsors"
sx={(theme) => ({
width: '100%',
p: 1,
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
borderRadius: 1,
border: '1px dashed',
transition: theme.transitions.create(['color', 'border-color', 'background-color']),
backgroundColor: alpha(theme.palette.primary[50], 0.5),
borderColor: (theme.vars || theme).palette.primary[200],
<Box
component="img"
height="27px"
width="90px"
src="/static/sponsors/marblism-light.svg"
alt="marblism"
title="AI web app generation"
loading="lazy"
sx={(theme) =>
theme.applyDarkStyles({
content: `url(/static/sponsors/marblism-dark.svg)`,
})
}
/>
</NativeLink>
<Link
href="/material-ui/discover-more/backers/#diamond-sponsors"
sx={(theme) => ({
p: 1.5,
width: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
borderRadius: 1,
border: '1px dashed',
transition: theme.transitions.create(['color', 'border-color', 'background-color']),
backgroundColor: alpha(theme.palette.primary[50], 0.5),
borderColor: (theme.vars || theme).palette.primary[200],
boxShadow: `inset 0 1px 1px ${
(theme.vars || theme).palette.grey[50]
}, 0 1px 2px ${alpha(theme.palette.primary[100], 0.8)}`,
'&:hover': {
backgroundColor: alpha(theme.palette.primary[100], 0.5),
borderColor: (theme.vars || theme).palette.primary[300],
},
...theme.applyDarkStyles({
backgroundColor: alpha(theme.palette.primary[700], 0.1),
borderColor: alpha(theme.palette.primary[400], 0.2),
boxShadow: `inset 0 1px 1px ${
(theme.vars || theme).palette.grey[50]
}, 0 1px 2px ${alpha(theme.palette.primary[100], 0.8)}`,
(theme.vars || theme).palette.primaryDark[800]
}, 0 1px 0.5px ${(theme.vars || theme).palette.common.black}`,
'&:hover': {
backgroundColor: alpha(theme.palette.primary[100], 0.5),
borderColor: (theme.vars || theme).palette.primary[300],
backgroundColor: alpha(theme.palette.primary[700], 0.2),
borderColor: (theme.vars || theme).palette.primary[400],
},
...theme.applyDarkStyles({
backgroundColor: alpha(theme.palette.primary[400], 0.05),
borderColor: alpha(theme.palette.primary[300], 0.3),
boxShadow: `inset 0 1px 1px ${
(theme.vars || theme).palette.primaryDark[800]
}, 0 1px 0.5px ${(theme.vars || theme).palette.common.black}`,
'&:hover': {
backgroundColor: alpha(theme.palette.primary[400], 0.1),
borderColor: (theme.vars || theme).palette.primary[400],
},
}),
})}
>
<Typography variant="caption" fontWeight="semiBold" textAlign="center">
{t('becomeADiamondSponsor')}
</Typography>
{/* <Typography variant="caption" fontWeight="regular" color="text.secondary">
{t('diamondSponsorVacancies')}
</Typography> */}
</Link>
</Stack>
}),
})}
>
<Typography variant="caption" fontWeight="semiBold" textAlign="center">
{t('becomeADiamondSponsor')}
</Typography>
{/* <Typography variant="caption" fontWeight="regular" color="text.secondary">
{t('diamondSponsorVacancies')}
</Typography> */}
</Link>
</Stack>
);
}