From 95ffd84aeb8d8c546d7d753456f7d89b89432ebd Mon Sep 17 00:00:00 2001 From: Tim Rijkse Date: Fri, 16 Jan 2026 10:37:43 +0100 Subject: [PATCH] fix: purple pushbox --- book.html | 6 +++--- js/components/content-tabs.js | 28 ++++++++++++++-------------- js/components/push-box.js | 28 +++++++++++++++++++++++++--- 3 files changed, 42 insertions(+), 20 deletions(-) diff --git a/book.html b/book.html index 074f300..711493d 100644 --- a/book.html +++ b/book.html @@ -132,10 +132,10 @@
- +

- Gespecialiseerd op het vlak van boeddhisme en aanverwante - Oost-West thema's + Kom je er niet uit of heb je een vraag? Neem contact op met de + klantenservice.

Klantenservice diff --git a/js/components/content-tabs.js b/js/components/content-tabs.js index 85080a7..15cff59 100644 --- a/js/components/content-tabs.js +++ b/js/components/content-tabs.js @@ -74,6 +74,7 @@ class ContentTabs extends HTMLElement {
diff --git a/js/components/push-box.js b/js/components/push-box.js index fe9dfa6..1eb0a66 100644 --- a/js/components/push-box.js +++ b/js/components/push-box.js @@ -2,10 +2,11 @@ * Push Box Component * A promotional container with logo, title, and CTA * Uses slots for all content to allow easy customization in HTML + * Supports variant="purple" for purple background with white content */ class PushBox extends HTMLElement { static get observedAttributes() { - return ["background-color", "text-color"]; + return ["background-color", "text-color", "variant"]; } constructor() { @@ -48,7 +49,18 @@ class PushBox extends HTMLElement { } } + get variant() { + return this.getAttribute("variant") || "default"; + } + + get isPurple() { + return this.variant === "purple"; + } + get backgroundColor() { + if (this.isPurple) { + return "#951D51"; + } return ( this.getAttribute("background-color") || "var(--color-push-box-bg, #EBEEF4)" @@ -56,9 +68,19 @@ class PushBox extends HTMLElement { } get textColor() { + if (this.isPurple) { + return "#FFFFFF"; + } return this.getAttribute("text-color") || "#951D51"; } + get titleColor() { + if (this.isPurple) { + return "#FFFFFF"; + } + return "#000000"; + } + render() { this.shadowRoot.innerHTML = `