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

Inner list action looks inconsistent with card header action #12291

Closed
2 tasks done
TrySound opened this issue Jul 26, 2018 · 9 comments
Closed
2 tasks done

Inner list action looks inconsistent with card header action #12291

TrySound opened this issue Jul 26, 2018 · 9 comments
Labels
component: card This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process.

Comments

@TrySound
Copy link
Contributor

TrySound commented Jul 26, 2018

Inner list action looks inconsistent with card header action

  • This is a v1.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

More consistent spaces

Current Behavior

image

image

Steps to Reproduce

Link: https://codesandbox.io/s/n55mqrjpjj

@TrySound
Copy link
Contributor Author

TrySound commented Jul 26, 2018

It also looks like action button is too close to the edge of paper on small screens
image

@mbrookes
Copy link
Member

@TrySound

404 Not Found
We could not find the sandbox you're looking for

@TrySound
Copy link
Contributor Author

@mbrookes Fixed the link

@oliviertassinari
Copy link
Member

@TrySound Following the specification I think that the list implementation is correct, we can change the card to be more consitent.
capture d ecran 2018-07-26 a 23 58 26
https://material.io/design/components/lists.html#specs
What about using marginRight: -12, here?
https://github.com/mui-org/material-ui/blob/9c671898ad6cf01281fd99b5d0d8ee11344b63db/packages/material-ui/src/CardHeader/CardHeader.js#L25

@oliviertassinari oliviertassinari added good first issue Great for first contributions. Enable to learn the contribution process. component: card This is the name of the generic UI component, not the React module! labels Jul 26, 2018
@TrySound
Copy link
Contributor Author

Yep, that would be good. But the issue is mostly about list item action which should follow the same spec.

@TrySound
Copy link
Contributor Author

I mean it doesn't have media query.

@mbrookes
Copy link
Member

mbrookes commented Jul 26, 2018

It also looks like action button is too close to the edge of paper on small screens

Looks like the padding on the card-header is reduce at < 600px width, so the negative margin on the icon needs to reduced to compensate which is an easy fix.

What about using marginRight: -12, here?

Just what I had 😄:

    marginRight: -12,
    [theme.breakpoints.up('sm')]: {
      marginRight: -20,
    },

However aligning the icon with the ListItem breaks makes the misalignment with the CardActions more obvious:

image

(Top and bottom right icons.)

We could add negative margin to the icons in the demo:

  expand: {
    transform: 'rotate(0deg)',
    transition: theme.transitions.create('transform', {
      duration: theme.transitions.duration.shortest,
    }),
    marginLeft: 'auto',
    [theme.breakpoints.up('sm')]: {
      marginRight: -8,
    },
  },

@mbrookes
Copy link
Member

Yep, that would be good. But the issue is mostly about list item action which should follow the same spec.

That is the spec for ListItem, and the action icon follows it. It's about changing the Card to match it.

@TrySound
Copy link
Contributor Author

is position: absolute; right: 4px a material spec?

mbrookes added a commit that referenced this issue Jul 26, 2018
<!-- Thanks so much for your PR, your contribution is appreciated! ❤️ -->
Closes #12291 

![image](https://user-images.githubusercontent.com/357702/43292552-be1ede14-912d-11e8-9dca-9f05755242e3.png)
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! good first issue Great for first contributions. Enable to learn the contribution process.
Projects
None yet
Development

No branches or pull requests

3 participants