Skip to content

Commit

Permalink
Mwpw-147034: Custom border color + badge/border color decoupling [Mer…
Browse files Browse the repository at this point in the history
…ch card]
  • Loading branch information
Axelcureno committed Jun 24, 2024
1 parent ecf0570 commit 0c50e78
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions web-components/src/merch-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export class MerchCard extends LitElement {
variant: { type: String, reflect: true },
size: { type: String, attribute: 'size', reflect: true },
badgeColor: { type: String, attribute: 'badge-color' },
borderColor: { type: String, attribute: 'border-color' },
badgeBackgroundColor: {
type: String,
attribute: 'badge-background-color',
Expand Down Expand Up @@ -110,10 +111,12 @@ export class MerchCard extends LitElement {

updated(changedProperties) {
if (
changedProperties.has('badgeBackgroundColor') &&
(changedProperties.has('badgeBackgroundColor') || changedProperties.has('borderColor')) &&
this.variant !== 'twp'
) {
this.style.border = `1px solid ${this.badgeBackgroundColor}`;
this.style.border = `1px solid ${
this.borderColor ? this.borderColor : this.badgeBackgroundColor
}`;
}
this.updateComplete.then(async () => {
const prices = Array.from(
Expand Down

0 comments on commit 0c50e78

Please sign in to comment.