-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! fixup! fixup! fixup! Feat(web): Introduce
Card
component #DS…
…-1397
- Loading branch information
1 parent
19f42d2
commit 028a33d
Showing
10 changed files
with
560 additions
and
128 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
// 1. Make card text selectable. | ||
// 1. Make card text selectable when there is a stretched CardLink. | ||
|
||
@use 'tools'; | ||
|
||
.CardBody { | ||
@include tools.add-bottom-spacing(); | ||
@include tools.add-bottom-margin(); | ||
|
||
grid-area: body; | ||
} | ||
|
||
// 1. | ||
.CardBody p { | ||
.Card:has(.CardLink) > .CardBody p { | ||
position: relative; | ||
z-index: 1; | ||
} |
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,28 @@ | ||
// 1. Restore interactions for individual actions. | ||
|
||
@use '../../tools/dictionaries'; | ||
@use 'theme'; | ||
@use 'tools'; | ||
|
||
.CardFooter { | ||
@include tools.add-bottom-margin(); | ||
|
||
z-index: 1; | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: wrap; | ||
grid-area: footer; | ||
gap: theme.$footer-gap; | ||
pointer-events: none; | ||
} | ||
|
||
// 1. | ||
.CardFooter :where(a:not(.CardLink), button) { | ||
pointer-events: auto; | ||
} | ||
|
||
@include dictionaries.generate-alignments( | ||
$class-name: 'CardFooter', | ||
$dictionary-values: theme.$footer-alignment-dictionary, | ||
$axis: 'x' | ||
); |
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 |
---|---|---|
@@ -1,60 +1,66 @@ | ||
// 1. We need the specific combination of classes, expanded CardMedia is designed to work only with boxed cards. | ||
|
||
@use '@tokens' as tokens; | ||
@use '../../tools/dictionaries'; | ||
@use 'theme'; | ||
@use 'tools'; | ||
|
||
.CardMedia { | ||
--card-media-border-radius-top-left: #{theme.$border-radius}; | ||
--card-media-border-radius-top-right: #{theme.$border-radius}; | ||
--card-media-border-radius-bottom-left: #{theme.$border-radius}; | ||
--card-media-border-radius-bottom-right: #{theme.$border-radius}; | ||
--card-media-canvas-width: auto; | ||
--card-media-canvas-height: auto; | ||
--#{tokens.$css-variable-prefix}card-media-border-radius-top-left: #{theme.$border-radius}; | ||
--#{tokens.$css-variable-prefix}card-media-border-radius-top-right: #{theme.$border-radius}; | ||
--#{tokens.$css-variable-prefix}card-media-border-radius-bottom-left: #{theme.$border-radius}; | ||
--#{tokens.$css-variable-prefix}card-media-border-radius-bottom-right: #{theme.$border-radius}; | ||
--#{tokens.$css-variable-prefix}card-media-canvas-width: auto; | ||
--#{tokens.$css-variable-prefix}card-media-canvas-height: auto; | ||
|
||
grid-area: media; | ||
} | ||
|
||
@include dictionaries.generate-sizes($class-name: 'CardMedia', $sizes: theme.$media-sizes); | ||
|
||
.CardMedia__canvas { | ||
width: var(--card-media-canvas-width); | ||
height: var(--card-media-canvas-height); | ||
width: var(--#{tokens.$css-variable-prefix}card-media-canvas-width); | ||
height: var(--#{tokens.$css-variable-prefix}card-media-canvas-height); | ||
overflow: hidden; | ||
border-radius: var(--card-media-border-radius-top-left) var(--card-media-border-radius-top-right) | ||
var(--card-media-border-radius-bottom-right) var(--card-media-border-radius-bottom-left); | ||
border-radius: var(--#{tokens.$css-variable-prefix}card-media-border-radius-top-left) | ||
var(--#{tokens.$css-variable-prefix}card-media-border-radius-top-right) | ||
var(--#{tokens.$css-variable-prefix}card-media-border-radius-bottom-right) | ||
var(--#{tokens.$css-variable-prefix}card-media-border-radius-bottom-left); | ||
} | ||
|
||
.CardMedia__canvas > :is(img, picture > img, video) { | ||
.CardMedia__canvas :is(img, picture > img, video) { | ||
width: 100%; | ||
height: 100%; | ||
object-fit: cover; | ||
} | ||
|
||
.Card--vertical > .CardMedia { | ||
--card-media-canvas-height: var(--spirit-card-media-size); | ||
--#{tokens.$css-variable-prefix}card-media-canvas-height: var(--spirit-card-media-size); | ||
|
||
@include tools.add-bottom-spacing($spacing: theme.$gap-dense); | ||
@include tools.add-bottom-margin($margin: theme.$gap-dense); | ||
} | ||
|
||
:is(.Card--horizontal, .Card--horizontalReversed) > .CardMedia { | ||
--card-media-canvas-width: var(--spirit-card-media-size); | ||
--card-media-canvas-height: 100%; | ||
--#{tokens.$css-variable-prefix}card-media-canvas-width: var(--spirit-card-media-size); | ||
} | ||
|
||
:is(.Card--horizontal, .Card--horizontalReversed) > :is(.CardMedia--expanded, .CardMedia--filledHeight) { | ||
--#{tokens.$css-variable-prefix}card-media-canvas-height: 100%; | ||
} | ||
|
||
// stylelint-disable selector-max-class -- 1. | ||
.Card--vertical.Card--boxed > .CardMedia--expanded:not(:last-child) { | ||
--card-media-border-radius-bottom-left: 0; | ||
--card-media-border-radius-bottom-right: 0; | ||
--#{tokens.$css-variable-prefix}card-media-border-radius-bottom-left: 0; | ||
--#{tokens.$css-variable-prefix}card-media-border-radius-bottom-right: 0; | ||
} | ||
|
||
.Card--horizontal.Card--boxed > .CardMedia--expanded:not(:last-child) { | ||
--card-media-border-radius-top-right: 0; | ||
--card-media-border-radius-bottom-right: 0; | ||
--#{tokens.$css-variable-prefix}card-media-border-radius-top-right: 0; | ||
--#{tokens.$css-variable-prefix}card-media-border-radius-bottom-right: 0; | ||
} | ||
|
||
.Card--horizontalReversed.Card--boxed > .CardMedia--expanded:not(:last-child) { | ||
--card-media-border-radius-top-left: 0; | ||
--card-media-border-radius-bottom-left: 0; | ||
--#{tokens.$css-variable-prefix}card-media-border-radius-top-left: 0; | ||
--#{tokens.$css-variable-prefix}card-media-border-radius-bottom-left: 0; | ||
} | ||
// stylelint-enable |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
@use 'theme'; | ||
|
||
@mixin add-bottom-spacing($spacing: theme.$gap) { | ||
@mixin add-bottom-margin($margin: theme.$gap) { | ||
&:not(:last-child) { | ||
margin-bottom: $spacing; | ||
margin-bottom: $margin; | ||
} | ||
} |
Oops, something went wrong.