-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored card to remove breakpoint classes (#1872)
Signed-off-by: Travis Beckham <[email protected]>
- Loading branch information
1 parent
4972bd8
commit 6ad88ff
Showing
11 changed files
with
110 additions
and
103 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,6 @@ | ||
@media (min-width: breakpoint-min-width("md")) { | ||
.test-card { | ||
@include make-card--horz; | ||
@include make-card--reverse; | ||
} | ||
} |
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,85 @@ | ||
@mixin make-card { | ||
--card--center-body: center; | ||
|
||
display: flex; | ||
flex-direction: column; | ||
padding: spacer(2); | ||
background-color: $white; | ||
border-radius: $border-radius; | ||
box-shadow: $box-shadow; | ||
|
||
.card__body { | ||
display: flex; | ||
flex-direction: column; | ||
gap: spacer(4); | ||
flex-grow: 1; | ||
padding: spacer(3); | ||
} | ||
.card__header { | ||
@include make-stack(1); | ||
} | ||
.card__content { | ||
@include make-stack(3); | ||
flex-grow: 1; | ||
} | ||
.card__footer { | ||
display: flex; | ||
flex-direction: row; | ||
gap: spacer(3); | ||
} | ||
} | ||
|
||
// @options | ||
|
||
// Add padding around media to align with content | ||
@mixin make-card--inset-media { | ||
gap: spacer(4); | ||
padding: spacer(4); | ||
|
||
.card__body { | ||
padding: 0; | ||
} | ||
} | ||
|
||
// Move media horizontal to content | ||
@mixin make-card--horz { | ||
--card--center-body: left; // When card is horizontal, do not center items in card body | ||
flex-direction: row; | ||
} | ||
|
||
// Move media after content | ||
@mixin make-card--reverse { | ||
.card__body { | ||
order: 1; | ||
} | ||
.card__media { | ||
order: 2; | ||
} | ||
} | ||
|
||
// Center the media and body | ||
@mixin make-card--center { | ||
align-items: center; | ||
|
||
.card__body { | ||
align-items: var(--card--center-body); | ||
} | ||
} | ||
|
||
// Make the whole card clickable | ||
@mixin make-card-link { | ||
display: block; | ||
transition: all 0.3s ease-out; | ||
color: $navy; | ||
|
||
.card { | ||
height: 100%; | ||
} | ||
&:hover { | ||
transform: scale(1.05); | ||
|
||
.card { | ||
background-image: linear-gradient(160deg, tint-color($light-blue, 50%), $white); | ||
} | ||
} | ||
} |
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