-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(card): vertical alignment of footer (#1315)
- Loading branch information
1 parent
a4e75f6
commit 4f6ff65
Showing
4 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
"@rhds/elements": patch | ||
--- | ||
`<rh-card>`: ensure footer is always on the bottom of the card |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<div id="card-grid"> | ||
<rh-card> | ||
<h2 slot="header">Grid Card</h2> | ||
<p>In a grid, cards will fill all the available vertical space.</p> | ||
<rh-cta priority="primary" slot="footer"> | ||
<a href="#">Call to action</a> | ||
</rh-cta> | ||
</rh-card> | ||
|
||
<rh-card> | ||
<h2 slot="header">Grid Card with More Content</h2> | ||
<p> | ||
In such a case, all of the grid card's footers should be | ||
vertically aligned. Meaning, they should always rest in | ||
the bottom of their card. Even when one card has much more | ||
content than its neighbour, and thus fill more vertical space | ||
in it's body, the footers should still be aligned. | ||
</p> | ||
<rh-cta priority="primary" slot="footer"> | ||
<a href="#">Call to action</a> | ||
</rh-cta> | ||
</rh-card> | ||
|
||
<rh-card> | ||
<h2 slot="header">Grid Card</h2> | ||
<p> | ||
These kinds of situations should best be avoided. See the | ||
guidelines for more information. | ||
</p> | ||
<rh-cta priority="primary" slot="footer"> | ||
<a href="https://ux.redhat.com/elements/card/guidelines/#vertical-height">Read the Guidelines</a> | ||
</rh-cta> | ||
</rh-card> | ||
</div> | ||
|
||
<script type="module"> | ||
import '@rhds/elements/rh-cta/rh-cta.js'; | ||
import '@rhds/elements/rh-card/rh-card.js'; | ||
</script> | ||
|
||
<style> | ||
#card-grid { | ||
display: grid; | ||
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); | ||
gap: var(--rh-space-lg, 16px); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters