-
Notifications
You must be signed in to change notification settings - Fork 714
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce and share new card and card grid styles (#6334)
Also adds the `{% card %} <content> {% endcard %}` paired shortcode for more easily setting up the markup of each card. A few existing cards had broken or incorrect links, so this PR fixes those as well.
- Loading branch information
Showing
15 changed files
with
252 additions
and
249 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
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
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
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,100 @@ | ||
@use '../core/mixins' as *; | ||
@use '../core/variables' as *; | ||
|
||
.card-grid { | ||
display: grid; | ||
grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--card-min-width, 18rem)), 1fr)); | ||
gap: var(--card-grid-gap, 1rem); | ||
margin: 0 0 1rem; | ||
justify-content: center; | ||
|
||
.card { | ||
display: flex; | ||
flex-direction: column; | ||
|
||
border-radius: 0.5rem; | ||
padding: 0.75rem; | ||
margin: 0; | ||
gap: 0.5rem; | ||
background-color: var(--card-container-color, rgb(242, 245, 255)); | ||
height: auto; | ||
|
||
scroll-margin: 4rem; | ||
|
||
&.hidden { | ||
display: none; | ||
} | ||
|
||
&.outlined-card { | ||
border: 1px solid var(--card-border-color, rgba(0, 0, 0, .125)); | ||
} | ||
|
||
.card-header { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
align-items: center; | ||
|
||
// TODO(parlough): Remove these resets after bootstrap removed. | ||
border: none; | ||
background: none; | ||
margin: 0; | ||
padding: 0; | ||
|
||
.card-title { | ||
font-size: 1.25rem; | ||
font-weight: 500; | ||
margin: 0; | ||
overflow: hidden; | ||
font-family: $site-font-family-gsans; | ||
color: var(--card-title-color, $site-color-body); | ||
} | ||
} | ||
|
||
.card-content { | ||
display: flex; | ||
align-items: center; | ||
gap: 0.75rem; | ||
font-size: 0.95rem; | ||
color: var(--card-text-color, $site-color-body); | ||
|
||
p { | ||
code { | ||
font-size: 0.95em; | ||
background-color: rgba(0, 0, 0, .05); | ||
color: var(--card-text-color, $site-color-body); | ||
border-radius: .25rem; | ||
padding: .1rem .25rem; | ||
text-wrap: nowrap; | ||
} | ||
} | ||
} | ||
|
||
.material-symbols { | ||
user-select: none; | ||
} | ||
} | ||
|
||
a.card { | ||
.card-header { | ||
--card-title-color: #1967D2; | ||
|
||
.card-title { | ||
font-weight: 400; | ||
} | ||
} | ||
|
||
&:hover { | ||
@include interaction-style(3%); | ||
} | ||
|
||
&:active { | ||
@include interaction-style(6%); | ||
} | ||
|
||
&:focus-visible { | ||
outline: 2px solid var(--focus-outline-color); | ||
border-color: transparent; | ||
} | ||
} | ||
} |
Oops, something went wrong.