Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mwpw-147034: Custom border color + badge/border color decoupling [Mer… #15

Merged
merged 8 commits into from
Jul 23, 2024
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')) &&
Axelcureno marked this conversation as resolved.
Show resolved Hide resolved
this.variant !== 'twp'
) {
this.style.border = `1px solid ${this.badgeBackgroundColor}`;
this.style.border = `1px solid ${
this.borderColor ? this.borderColor : this.badgeBackgroundColor
}`;
Axelcureno marked this conversation as resolved.
Show resolved Hide resolved
}
this.updateComplete.then(async () => {
const prices = Array.from(
Expand Down