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

[materiaul-ui][Typography] Deprecate paragraph prop #16926

Closed
keul opened this issue Aug 8, 2019 · 13 comments · Fixed by #42383
Closed

[materiaul-ui][Typography] Deprecate paragraph prop #16926

keul opened this issue Aug 8, 2019 · 13 comments · Fixed by #42383
Assignees
Labels
component: Typography The React component. package: material-ui Specific to @mui/material v6.x

Comments

@keul
Copy link
Contributor

keul commented Aug 8, 2019

A small documentation issue at page https://material-ui.com/api/typography/

At props section (https://material-ui.com/api/typography/#props): inside the table paragraph and gutterBottom both reports If true, the text will have a bottom margin. which is confusing.

I guess is the paragraph description that is wrong.


Edit by @oliviertassinari.

A proposal: we deprecate the paragraph prop as they are likely already covered by the system props, e.g. mb.

@illuminist
Copy link

https://github.com/mui-org/material-ui/blob/cf75ed59666cb852f53f024ecaf57eb12fa64465/packages/material-ui/src/Typography/Typography.js#L72-L74

It also applies margin bottom, just a bit difference from what gutterBottom does.

@oliviertassinari oliviertassinari added component: Typography The React component. new feature New feature or request labels Aug 8, 2019
@oliviertassinari oliviertassinari changed the title Documentation issue on Typography [Typography] Improve margin handling Aug 8, 2019
@oliviertassinari oliviertassinari added the priority: important This change can make a difference label Aug 8, 2019
@oliviertassinari
Copy link
Member

This part of the Typography component is not pretty. I want to improve it since the release of v1. The documentation is not incorrect without being helpful. I would blame the implementation with the problem. I have personally almost never used the paragraph prop and use gutterBottom quite often.

What API would you like to see? As we are working toward moving the system into the core component, we should be able to leverage the m… props in the future.

@keul
Copy link
Contributor Author

keul commented Aug 8, 2019

To be honest I'm not using paragraph or gutterBottom neither. I just found this repetition by reading the whole docs looking for other.

I'm not sure if any API of this kind is required here.

@oliviertassinari
Copy link
Member

@keul How are you handling the spacing between two different Typography elements?

@keul
Copy link
Contributor Author

keul commented Aug 8, 2019

I don't have much on them in my application right now, but I commonly use some className for this purpose

@oliviertassinari
Copy link
Member

Ok, thanks for sharing.

@joshwooding
Copy link
Member

I tend to use paragraph when I want to add spacing :/

@oliviertassinari oliviertassinari removed the priority: important This change can make a difference label Dec 1, 2019
@oliviertassinari oliviertassinari added this to the v5 milestone Oct 10, 2020
@buchanaf
Copy link

buchanaf commented Jan 8, 2021

Is there any reason for this component not to inherit the Box-style margin interface? I rarely use Typography because of this reason.

@oliviertassinari
Copy link
Member

oliviertassinari commented Jan 8, 2021

@buchanaf What do you mean by margin interface? Like <Typography mb={2} />?

@buchanaf
Copy link

buchanaf commented Jan 8, 2021

@oliviertassinari, yes, exactly, including mx, my, etc.. Honestly, it'd be convenient for a lot of the more "primitive" components like Button.

@oliviertassinari
Copy link
Member

oliviertassinari commented Jan 8, 2021

@buchanaf <Button> already supports it in v5 under the sx prop. For the Typography, Box, Grid, Stack, 4 CSS utilities components, I have been advocating for having the subset of the system available as regular props.

@buchanaf
Copy link

buchanaf commented Jan 8, 2021

Ah, good to know. I look forward to it! Good luck with the rest and thanks for your work!

@oliviertassinari oliviertassinari modified the milestones: v5, v6 Jan 11, 2021
@oliviertassinari oliviertassinari changed the title [Typography] Improve margin handling [Typography] Remove gutterBottom and paragraph props (use system instead) Jan 11, 2021
@oliviertassinari oliviertassinari changed the title [Typography] Remove gutterBottom and paragraph props (use system instead) [Typography] Remove paragraph prop (use system instead) Apr 17, 2021
@oliviertassinari oliviertassinari changed the title [Typography] Remove paragraph prop (use system instead) [Typography] Remove paragraph prop (use system instead) Jan 11, 2023
@danilo-leal danilo-leal moved this to Backlog in Material UI Dec 1, 2023
@DiegoAndai DiegoAndai removed the v6.x label Feb 19, 2024
@aarongarciah
Copy link
Member

aarongarciah commented May 27, 2024

We are deprecating the paragraph prop in Typography for v6. We'll iterate on #42383

@aarongarciah aarongarciah added deprecation New deprecation message and removed deprecation New deprecation message labels May 27, 2024
@aarongarciah aarongarciah self-assigned this May 27, 2024
@aarongarciah aarongarciah added package: material-ui Specific to @mui/material and removed new feature New feature or request breaking change labels May 27, 2024
@aarongarciah aarongarciah changed the title [Typography] Remove paragraph prop (use system instead) [materiaul-ui][Typography] Deprecate paragraph prop May 27, 2024
@aarongarciah aarongarciah moved this from Backlog to In progress in Material UI Jul 1, 2024
@aarongarciah aarongarciah moved this from In progress to Selected in Material UI Jul 2, 2024
@aarongarciah aarongarciah moved this from Selected to In progress in Material UI Jul 16, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Material UI Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Typography The React component. package: material-ui Specific to @mui/material v6.x
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

7 participants