Skip to content

Commit 270b4da

Browse files
fix(styles): stretch single card to full width on smaller screens (#4330)
Co-authored-by: Brandy Smith <[email protected]>
1 parent fd7dd8f commit 270b4da

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/components/global/DocsCards/cards.css

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ docs-cards {
77

88
/*
99
* This prevents a single card from stretching the full width by
10-
* forcing a 2-column grid layout (a single card will only take up
11-
* 1 column instead of stretching across both). This is used on the
10+
* adding an invisible pseudo-element as a second grid item. This
11+
* creates a 2-column layout on larger screens (card takes 1 column)
12+
* and collapses to full width on smaller screens. This is used on the
1213
* Packages & CDN page by the JavaScript section.
1314
*/
14-
docs-cards:has(docs-card:only-child) {
15-
grid-template-columns: 1fr 1fr;
15+
docs-cards:has(docs-card:only-child)::after {
16+
content: '';
17+
display: block;
18+
visibility: hidden;
1619
}
1720

1821
docs-cards > docs-card {

0 commit comments

Comments
 (0)