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

[CardHeader] Action is not vertically centered in Card Header #21645

Closed
kgregory opened this issue Jul 2, 2020 · 2 comments · Fixed by #21646
Closed

[CardHeader] Action is not vertically centered in Card Header #21645

kgregory opened this issue Jul 2, 2020 · 2 comments · Fixed by #21646
Labels
design: material This is about Material Design, please involve a visual or UX designer in the process

Comments

@kgregory
Copy link
Member

kgregory commented Jul 2, 2020

This codesandbox illustrates this issue.

The action is positioned with a negative margin, but it appears to be too close top the top edge by 4px:

  /* Styles applied to the action element. */
  action: {
    flex: '0 0 auto',
    alignSelf: 'flex-start',
    marginTop: -8,
    marginRight: -8,
  },

image

In my repro, I've augmented the action class via override:

  adjustedCardHeaderAction: {
    position: "relative",
    top: 4
  },

image

I realize this isn't exactly highlighted in the MD spec any longer, but it is a nice example in our docs.

Is this worthy of a PR and if so, are there any concerns with my approach?

If this is worth addressing, I'd be happy to take care of it.

@kgregory kgregory added design: material This is about Material Design, please involve a visual or UX designer in the process status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jul 2, 2020
@mbrookes
Copy link
Member

mbrookes commented Jul 2, 2020

It's documented under "overflow menu", and does appear to be vertically centered (which I agree looks better), although in this example the designer hasn't allowed sufficient space to the right for the ripple:

image

https://material.io/components/cards#actions

@mbrookes mbrookes removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jul 2, 2020
@kgregory
Copy link
Member Author

kgregory commented Jul 2, 2020

@mbrookes thank you, I missed that. I can submit a PR.

May be as simple as:

  /* Styles applied to the action element. */
  action: {
    flex: '0 0 auto',
    alignSelf: 'flex-start',
    marginTop: -4,
    marginRight: -8,
    marginBottom: -4,
  },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design: material This is about Material Design, please involve a visual or UX designer in the process
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants