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

[CardContent] Use theme.spacing() instead of hardcoded values #32471

Open
wants to merge 8 commits into
base: v5.x
Choose a base branch
from

Conversation

MahmoudMans
Copy link

@MahmoudMans MahmoudMans commented Apr 26, 2022

Closes #32155

@mui-bot
Copy link

mui-bot commented Apr 26, 2022

Bundle size will be reported once CircleCI build #465837 finishes.

Generated by 🚫 dangerJS against 75b6f72

@MahmoudMans MahmoudMans changed the title Change hardcoded padding to themespacing cardcontent [Card] change CardContent padding so that it will use themespacing insted of hardcoded value Apr 27, 2022
Comment on lines 112 to 113
maxWidth: 'calc(150% - 24px)',
transform: 'translate(12px, -9px) scale(0.70)',
Copy link
Member

Choose a reason for hiding this comment

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

Why this change? Let's not change this.

Copy link
Author

Choose a reason for hiding this comment

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

@ZeeshanTamboli sorry this changes were related to another pull request

Comment on lines 8 to 10
import createTheme from '../styles/createTheme';

const theme = createTheme();
Copy link
Member

Choose a reason for hiding this comment

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

This is not needed. You can access the theme in styled() API

Copy link
Author

Choose a reason for hiding this comment

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

What do you mean we can access it through the api ? can you give me an example please

Copy link
Member

Choose a reason for hiding this comment

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

const StyledTableCell = styled(TableCell)(({ theme }) => ({

Copy link
Author

Choose a reason for hiding this comment

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

also i opened this pull request because of this issue #32155

@ZeeshanTamboli ZeeshanTamboli changed the title [Card] change CardContent padding so that it will use themespacing insted of hardcoded value [CardContent] Use theme.spacing() instead of hardcoded values Apr 27, 2022
@ZeeshanTamboli ZeeshanTamboli added the component: card This is the name of the generic UI component, not the React module! label Apr 27, 2022
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli left a comment

Choose a reason for hiding this comment

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

Also I think this would be a breaking change in case some apps have their own theme customization with their own spacing values as mentioned in #32155 (comment)

@ZeeshanTamboli ZeeshanTamboli added breaking change on hold There is a blocker, we need to wait labels Apr 27, 2022
@@ -22,9 +22,9 @@ const CardContentRoot = styled('div', {
overridesResolver: (props, styles) => styles.root,
})(() => {
return {
padding: 16,
padding: styled.theme.spacing(2),
Copy link
Member

Choose a reason for hiding this comment

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

TypeError: Cannot read property 'spacing' of undefined

Copy link
Member

Choose a reason for hiding this comment

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

It should be

})(({ theme }) => {
  return {
    padding: theme.spacing(2),

Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

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

Please take a look at the reviews.

Signed-off-by: Marija Najdova <mnajdova@gmail.com>
Signed-off-by: Marija Najdova <mnajdova@gmail.com>
@mnajdova mnajdova added the v6.x label Dec 23, 2022
Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Thanks, we will need to wait for v6 before we can merge this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change component: card This is the name of the generic UI component, not the React module! on hold There is a blocker, we need to wait v7.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Card] CardContent padding doesn't use spacing
7 participants