Skip to content

Consent policy styling updates

Choose a tag to compare

@fishwink fishwink released this 22 Apr 02:59
· 6 commits to main since this release
  1. includes/class-gfw-consent-policy.php:58 — the leaking [gfw_consent_preferences …] was a nested-shortcode issue (WP only parses shortcodes once on the_content; a shortcode's output isn't reparsed). Swapped the literal tag for a direct call to $this->shortcode_preferences(), so the button always renders.

  2. assets/css/banner.css:489-568 — replaced the 4-rule table block with a full policy stylesheet:

Typography rhythm: h2/h3/h4/p get explicit margins so sections breathe consistently, regardless of theme defaults.
Button: .gfw-consent-policy .gfw-consent-open-preferences now picks up --gfw-primary + --gfw-radius (same vars as the banner), so it matches the site's consent brand out of the box.
Dark/light theme-agnostic table: all backgrounds and borders use rgba(128, 128, 128, X) — a mid-gray with transparency. On a white page it reads as pale gray; on a black page it reads as faint light gray. Header uses 14% alpha, even rows 5%, borders 22–28%. No more invisible-text bug in dark themes. color: inherit on cells makes sure the text keeps the page's text color.
Mobile: under 640px the 6-column table becomes a horizontal-scroll block instead of mangling to a stack.