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

[Joy] Miscellaneous fixes #35552

Merged
merged 6 commits into from Dec 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 1 addition & 4 deletions docs/data/joy/components/aspect-ratio/CarouselRatio.js
Expand Up @@ -48,10 +48,7 @@ export default function CarouselRatio() {
'--Card-padding': (theme) => theme.spacing(2),
}}
>
<AspectRatio
ratio="1"
sx={{ minWidth: 60, borderRadius: 'sm', overflow: 'auto' }}
>
<AspectRatio ratio="1" sx={{ minWidth: 60 }}>
<img
src={`${item.src}?h=120&fit=crop&auto=format`}
srcSet={`${item.src}?h=120&fit=crop&auto=format&dpr=2 2x`}
Expand Down
5 changes: 1 addition & 4 deletions docs/data/joy/components/aspect-ratio/CarouselRatio.tsx
Expand Up @@ -48,10 +48,7 @@ export default function CarouselRatio() {
'--Card-padding': (theme) => theme.spacing(2),
}}
>
<AspectRatio
ratio="1"
sx={{ minWidth: 60, borderRadius: 'sm', overflow: 'auto' }}
>
<AspectRatio ratio="1" sx={{ minWidth: 60 }}>
<img
src={`${item.src}?h=120&fit=crop&auto=format`}
srcSet={`${item.src}?h=120&fit=crop&auto=format&dpr=2 2x`}
Expand Down
2 changes: 1 addition & 1 deletion docs/data/joy/components/css-baseline/css-baseline.md
Expand Up @@ -95,7 +95,7 @@ The CSS [`color-scheme`](https://web.dev/color-scheme/) is applied by default to

- No base font-size is declared on the `<html>`, but 16px is assumed (the browser default).
You can learn more about the implications of changing the `<html>` default font size in [the theme documentation](/material-ui/customization/typography/#html-font-size) page.
- Set the `theme.typography.body1` style on the `<body>` element.
- Set the default `Typography`'s level (`body1`) style on the `<body>` element. The style comes from `theme.typography.{default typography level prop}`.
- Set the font-weight to `bold` for the `<b>` and `<strong>` elements.
- Custom font-smoothing is enabled for better display of the default font.

Expand Down
3 changes: 2 additions & 1 deletion packages/mui-joy/src/AspectRatio/AspectRatio.tsx
Expand Up @@ -41,6 +41,7 @@ const AspectRatioRoot = styled('div', {
maxHeight || '9999px'
})`
: `calc(100% / (${ownerState.ratio}))`,
borderRadius: 'var(--AspectRatio-radius)',
flexDirection: 'column',
margin: 'var(--AspectRatio-margin)',
};
Expand All @@ -54,7 +55,7 @@ const AspectRatioContent = styled('div', {
{
flex: 1,
position: 'relative',
borderRadius: 'var(--AspectRatio-radius)',
borderRadius: 'inherit',
height: 0,
paddingBottom: 'var(--AspectRatio-paddingBottom)',
overflow: 'hidden',
Expand Down
8 changes: 5 additions & 3 deletions packages/mui-joy/src/styles/extendTheme.ts
Expand Up @@ -546,16 +546,18 @@ export default function extendTheme(themeOptions?: CssVarsThemeOptions): Theme {
margin: 'var(--Icon-margin)',
...(ownerState.fontSize &&
ownerState.fontSize !== 'inherit' && {
fontSize: `var(--Icon-fontSize, ${themeProp.fontSize[ownerState.fontSize]})`,
fontSize: `var(--Icon-fontSize, ${
themeProp.vars.fontSize[ownerState.fontSize]
})`,
}),
...(ownerState.color &&
ownerState.color !== 'inherit' &&
ownerState.color !== 'context' &&
themeProp.vars.palette[ownerState.color!] && {
color: themeProp.vars.palette[ownerState.color].plainColor,
color: `rgba(${themeProp.vars.palette[ownerState.color]?.mainChannel} / 1)`,
}),
...(ownerState.color === 'context' && {
color: theme.variants.plain?.context?.color,
color: themeProp.vars.palette.text.secondary,
}),
...(instanceFontSize &&
instanceFontSize !== 'inherit' && {
Expand Down
14 changes: 14 additions & 0 deletions test/regressions/fixtures/AspectRatioJoy/AspectRatioRadius.js
@@ -0,0 +1,14 @@
import * as React from 'react';
import { CssVarsProvider } from '@mui/joy/styles';
import AspectRatio from '@mui/joy/AspectRatio';
import Box from '@mui/joy/Box';

export default function VariantColorJoy() {
return (
<CssVarsProvider>
<Box sx={{ p: 2, bgcolor: 'red' }}>
<AspectRatio sx={{ borderRadius: 'xl', minWidth: 200 }} />
</Box>
</CssVarsProvider>
);
}