Title of Card appears to be misaligned when Button is a child of Card.Header.
<Card.Header title="Title">
<Button>
</Card.Header>
Expect title and button to appear aligned.

https://codesandbox.io/s/zwoxr5l0xl
@ry5n and @sarahill, this issue appears to be closely aligned (pun intended) with #977.
@ry5n and @sarahill, this issue appears to be closely aligned (pun intended) with #977.
I'm not sure in this case that there's anything the component should do here. Since the header accepts a React node, I think it's up to the consumer to space/align the children they provide as they see fit, because the header can't anticipate what its children will be.
I鈥檓 kind of surprised that Card.Header takes a title prop at all, since I assumed it was an escape hatch for taking control of the header layout. I would have expected I鈥檇 need to include my own Heading, which would let me control its alignment with any actions. However, even if I don鈥檛 pass a title, Card.Header renders its markup anyway (A Stack with an empty Heading).
This is maybe where we can improve things.
^ This
This issue has been inactive for 180 days and labeled with Icebox. It will be closed in 7 days if there is no further activity.
I'm having the same problem when using SkeletonDisplayText component for the title while loading.
For anyone else wanting a quick fix:
.Polaris-Card__Header .Polaris-Stack {
align-items: center;
}
Most helpful comment
I鈥檓 kind of surprised that
Card.Headertakes atitleprop at all, since I assumed it was an escape hatch for taking control of the header layout. I would have expected I鈥檇 need to include my ownHeading, which would let me control its alignment with any actions. However, even if I don鈥檛 pass atitle,Card.Headerrenders its markup anyway (AStackwith an emptyHeading).This is maybe where we can improve things.