This repository has been archived by the owner on Jun 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Select an image to display for credit cards based on the brand. (#537)
Co-authored-by: Hinton <oscar@oscarhinton.com>
- Loading branch information
1 parent
36b3aea
commit e966645
Showing
18 changed files
with
67 additions
and
0 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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,44 @@ | ||
$card-icons-base: "~@bitwarden/jslib-angular/src/images/cards/"; | ||
$card-icons: ( | ||
"visa": $card-icons-base + "visa-light.png", | ||
"amex": $card-icons-base + "amex-light.png", | ||
"diners-club": $card-icons-base + "diners_club-light.png", | ||
"discover": $card-icons-base + "discover-light.png", | ||
"jcb": $card-icons-base + "jcb-light.png", | ||
"maestro": $card-icons-base + "maestro-light.png", | ||
"mastercard": $card-icons-base + "mastercard-light.png", | ||
"union-pay": $card-icons-base + "union_pay-light.png", | ||
); | ||
|
||
$card-icons-dark: ( | ||
"visa": $card-icons-base + "visa-dark.png", | ||
"amex": $card-icons-base + "amex-dark.png", | ||
"diners-club": $card-icons-base + "diners_club-dark.png", | ||
"discover": $card-icons-base + "discover-dark.png", | ||
"jcb": $card-icons-base + "jcb-dark.png", | ||
"maestro": $card-icons-base + "maestro-dark.png", | ||
"mastercard": $card-icons-base + "mastercard-dark.png", | ||
"union-pay": $card-icons-base + "union_pay-dark.png", | ||
); | ||
|
||
.credit-card-icon { | ||
display: block; // Resolves the parent container being slighly to big | ||
height: 19px; | ||
width: 24px; | ||
background-size: contain; | ||
background-repeat: no-repeat; | ||
} | ||
|
||
@each $name, $url in $card-icons { | ||
.card-#{$name} { | ||
background-image: url("#{$url}"); | ||
} | ||
} | ||
|
||
@each $theme in $dark-icon-themes { | ||
@each $name, $url in $card-icons-dark { | ||
.#{$theme} .card-#{$name} { | ||
background-image: url("#{$url}"); | ||
} | ||
} | ||
} |