From da7132d4ced40a941592941605a6b9cda6e066ef Mon Sep 17 00:00:00 2001 From: Clemens Creutzburg Date: Thu, 27 Aug 2026 12:46:44 +0200 Subject: [PATCH] Cookie-Banner klarer gestalten --- app/analytics.php | 6 +++--- assets/css/privacy-settings.css | 11 +++++++++++ scripts/check-analytics-consent.php | 10 ++++++++-- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/app/analytics.php b/app/analytics.php index 6902400..f0b4237 100644 --- a/app/analytics.php +++ b/app/analytics.php @@ -145,12 +145,12 @@ function app_analytics_body_html(): string diff --git a/assets/css/privacy-settings.css b/assets/css/privacy-settings.css index 3e69adf..df99dd6 100644 --- a/assets/css/privacy-settings.css +++ b/assets/css/privacy-settings.css @@ -75,6 +75,17 @@ border-color: #2f6418; } +.analytics-consent__actions [data-analytics-consent="denied"] { + background: #ffffff; + color: #2f6418 !important; +} + +.analytics-consent__actions [data-analytics-consent="denied"]:hover { + background: #f2f7ef; + border-color: #2f6418; + color: #244f13 !important; +} + .analytics-consent__actions button:focus-visible, .analytics-consent-settings:focus-visible { outline: solid 3px #f0b429; diff --git a/scripts/check-analytics-consent.php b/scripts/check-analytics-consent.php index 251a121..1dc2b22 100644 --- a/scripts/check-analytics-consent.php +++ b/scripts/check-analytics-consent.php @@ -61,8 +61,14 @@ $head = app_analytics_head_html(); $body = app_analytics_body_html(); $assert('Consent-Stylesheet wird lokal und filterarm geladen', str_contains($head, 'assets/css/privacy-settings.css')); $assert('Zustimmen und Ablehnen stehen in derselben Ebene', - str_contains($body, 'data-analytics-consent="denied"') - && str_contains($body, 'data-analytics-consent="granted"')); + str_contains($body, 'data-analytics-consent="denied">Nur notwendige Cookies') + && str_contains($body, 'data-analytics-consent="granted">Zustimmen')); +$assert('Einwilligungsdialog ist eindeutig benannt', + str_contains($body, '')); +$consentCss = file_get_contents(APP_ROOT . '/assets/css/privacy-settings.css') ?: ''; +$assert('Nur notwendige Cookies ist innen weiß gestaltet', + str_contains($consentCss, '[data-analytics-consent="denied"]') + && str_contains($consentCss, 'background: #ffffff;')); $assert('Matomo selbst ist im HTML nicht vorab eingebunden', !str_contains($body, 'https://analytics.example.test') && !str_contains($body, '"siteId"'));