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

[Card] Fix CardActions spacing for different button components #31885

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Mar 18, 2022

Noticed that the spacing was off when different components are used for Card actions. See the spacing between second and third action here.

Also fixes #29819

@mui-bot
Copy link

mui-bot commented Mar 18, 2022

Netlify deploy preview

https://deploy-preview-31885--material-ui.netlify.app/

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against ba2f49e

@Janpot Janpot marked this pull request as draft March 18, 2022 16:58
@danilo-leal danilo-leal changed the title [fix] Card Actions spacing for different button components [Card] Fix CardActions spacing for different button components Mar 18, 2022
@danilo-leal danilo-leal added the component: card This is the name of the generic UI component, not the React module! label Mar 18, 2022
@Janpot Janpot marked this pull request as ready for review March 18, 2022 17:50
@Janpot
Copy link
Member Author

Janpot commented Mar 18, 2022

Just noticed AccordionActions and DialogActions use a similar implementation for their spacing

@mnajdova mnajdova requested a review from siriwatknp March 23, 2022 12:37
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.

Using gap is perfect but due to browser support being at 88% (at least, I think it should be 90%), I don't think it is safe to use gap at this point. I propose to not do anything at this point because I don't see a better approach at this point because using margin always stuck in some cases and developers can use sx to add the margin on their own.

'& > * + *': {
  marginLeft: 8, // only works in row, but not the column direction
},

@Janpot Janpot mentioned this pull request Mar 23, 2022
2 tasks
@Janpot
Copy link
Member Author

Janpot commented Mar 23, 2022

@siriwatknp Understood, I added this PR on the list of #30660

@siriwatknp
Copy link
Member

We can merge this in v7.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 14, 2024
@Janpot
Copy link
Member Author

Janpot commented Mar 14, 2024

@siriwatknp I've merged master and replaced the tests with integration tests. The tests were testing implementation details and that's rather useless in this case (i.e. the computed styles don't necessarily guarantee the gap is correct visually, other properties may affect it).

@siriwatknp
Copy link
Member

siriwatknp commented Mar 15, 2024

@siriwatknp I've merged master and replaced the tests with integration tests. The tests were testing implementation details and that's rather useless in this case (i.e. the computed styles don't necessarily guarantee the gap is correct visually, other properties may affect it).

I think it's fine to not have extra tests for this (the demos' visual regression should be enough). Feel free to remove them.

@Janpot
Copy link
Member Author

Janpot commented Mar 15, 2024

Feel free to remove them.

It can't find any demo that covers this specific case. Perhaps it's best to keep them?

@Janpot Janpot changed the base branch from master to next March 21, 2024 11:00
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label May 6, 2024
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

[ButtonGroup] CardActions spacing is not working
7 participants