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

[material-ui] Remove display="block" usage to work with Pigment CSS #43307

Merged
merged 8 commits into from
Aug 16, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions packages/mui-material/src/CardHeader/CardHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import composeClasses from '@mui/utils/composeClasses';
import Typography from '../Typography';
import Typography, { typographyClasses } from '../Typography';
import { styled } from '../zero-styled';
import { useDefaultProps } from '../DefaultPropsProvider';
import cardHeaderClasses, { getCardHeaderUtilityClass } from './cardHeaderClasses';
Expand Down Expand Up @@ -65,6 +65,12 @@ const CardHeaderContent = styled('div', {
overridesResolver: (props, styles) => styles.content,
})({
flex: '1 1 auto',
[`.${typographyClasses.root}:where(& .${cardHeaderClasses.title})`]: {
display: 'block',
},
[`.${typographyClasses.root}:where(& .${cardHeaderClasses.subheader})`]: {
display: 'block',
},
});

const CardHeader = React.forwardRef(function CardHeader(inProps, ref) {
Expand Down Expand Up @@ -97,7 +103,6 @@ const CardHeader = React.forwardRef(function CardHeader(inProps, ref) {
variant={avatar ? 'body2' : 'h5'}
className={classes.title}
component="span"
display="block"
{...titleTypographyProps}
>
{title}
Expand All @@ -113,7 +118,6 @@ const CardHeader = React.forwardRef(function CardHeader(inProps, ref) {
className={classes.subheader}
color="textSecondary"
component="span"
display="block"
{...subheaderTypographyProps}
>
{subheader}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import composeClasses from '@mui/utils/composeClasses';
import { useFormControl } from '../FormControl';
import { styled } from '../zero-styled';
import { useDefaultProps } from '../DefaultPropsProvider';
import Stack from '../Stack';
import Typography from '../Typography';
import capitalize from '../utils/capitalize';
import formControlLabelClasses, {
Expand Down Expand Up @@ -195,12 +194,12 @@ const FormControlLabel = React.forwardRef(function FormControlLabel(inProps, ref
>
{React.cloneElement(control, controlProps)}
{required ? (
<Stack display="block">
siriwatknp marked this conversation as resolved.
Show resolved Hide resolved
<div>
{label}
<AsteriskComponent ownerState={ownerState} aria-hidden className={classes.asterisk}>
&thinsp;{'*'}
</AsteriskComponent>
</Stack>
</div>
) : (
label
)}
Expand Down
10 changes: 7 additions & 3 deletions packages/mui-material/src/ListItemText/ListItemText.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import composeClasses from '@mui/utils/composeClasses';
import Typography from '../Typography';
import Typography, { typographyClasses } from '../Typography';
import ListContext from '../List/ListContext';
import { styled } from '../zero-styled';
import { useDefaultProps } from '../DefaultPropsProvider';
Expand Down Expand Up @@ -41,6 +41,12 @@ const ListItemTextRoot = styled('div', {
minWidth: 0,
marginTop: 4,
marginBottom: 4,
[`.${typographyClasses.root}:where(& .${listItemTextClasses.primary})`]: {
display: 'block',
},
[`.${typographyClasses.root}:where(& .${listItemTextClasses.secondary})`]: {
display: 'block',
},
variants: [
{
props: ({ ownerState }) => ownerState.primary && ownerState.secondary,
Expand Down Expand Up @@ -93,7 +99,6 @@ const ListItemText = React.forwardRef(function ListItemText(inProps, ref) {
variant={dense ? 'body2' : 'body1'}
className={classes.primary}
component={primaryTypographyProps?.variant ? undefined : 'span'}
display="block"
{...primaryTypographyProps}
>
{primary}
Expand All @@ -107,7 +112,6 @@ const ListItemText = React.forwardRef(function ListItemText(inProps, ref) {
variant="body2"
className={classes.secondary}
color="textSecondary"
display="block"
{...secondaryTypographyProps}
>
{secondary}
Expand Down