Compact Mobile
Reduce padding and stack buttons vertically below 480 px — without hiding or shrinking the Reject All button.
On very small screens (watches, older budget phones, narrow browser windows) the default banner layout can feel cramped. This recipe applies tighter internal spacing, reduces the button group gap, and stacks buttons in a column at ≤ 480 px — all while keeping every action button fully visible and equally accessible.
The CSS
Section titled “The CSS”/* ── Compact mobile layout ─────────────────────────────── */
@media (max-width: 480px) { /* Tighter inner padding */ .ag-banner .ag-banner-inner { padding: 16px; }
/* Smaller title */ .ag-banner .ag-title { font-size: 1rem; margin-bottom: 8px; }
/* Smaller description text */ .ag-banner .ag-desc { font-size: 0.8125rem; line-height: 1.4; margin-bottom: 12px; }
/* Stack buttons vertically; full-width for easy tap targets */ .ag-banner .ag-btns { flex-direction: column; gap: 8px; }
/* Full-width buttons */ .ag-banner .ag-btn { width: 100%; justify-content: center; }
/* Tighten link area */ .ag-banner .ag-links { margin-top: 10px; font-size: 0.75rem; }}Live preview
Section titled “Live preview”classic · dialog · bottom What’s happening
Section titled “What’s happening”@media (max-width: 480px)scopes all changes to narrow viewports. The desktop layout is untouched..ag-banner-inner { padding: 16px }reduces the banner’s inner breathing room from the default 24 px to 16 px, recovering ~64 px of vertical space across four sides..ag-btns { flex-direction: column }switches the button row into a vertical column, so each button spans the full width — easier to tap on touch devices..ag-btn { width: 100% }ensures each button fills the column. Without this, the buttons shrink to content width even in a column layout.- Font-size adjustments on
.ag-titleand.ag-descavoid text wrapping into many lines at small widths.
Variations
Section titled “Variations”Even tighter (≤ 360 px, very small phones):
@media (max-width: 360px) { .ag-banner .ag-banner-inner { padding: 12px; } .ag-banner .ag-title { font-size: 0.9375rem; } .ag-banner .ag-desc { font-size: 0.75rem; }}Keep buttons side-by-side but smaller gap:
@media (max-width: 480px) { .ag-banner .ag-btns { gap: 6px; } .ag-banner .ag-btn { padding: 8px 14px; font-size: 0.8125rem; }}Compliance notes
Section titled “Compliance notes”This recipe does not touch button visibility, color, or opacity — it only changes spacing and layout. All three action buttons (Accept All, Reject All, Customise) remain visible and accessible.
Related recipes
Section titled “Related recipes”- Brand Colors — visual style to pair with compact layout
- Responsive Design — full reference for breakpoints and layout strategies
- GDPR Compliance Risks — complete list of dark patterns to avoid