Skip to content

Alert/Callout Block with Variants #12

@widoz

Description

@widoz

Context

Create alert/callout block with multiple variants (info, warning, success, error, destructive) and optional dismiss functionality.

Requirements

  • Create /sources/Blocks/Alert/:
    • Variants: default, info, warning, success, error, destructive
    • Optional icon support (dashicons or SVG)
    • Optional title and description areas
    • Dismissible option with fade-out animation
    • InnerBlocks for flexible content

Implementation Notes

  • Use block variations for different alert types
  • Each variant uses appropriate theme colors
  • Ensure WCAG AA contrast for all variants
  • Dismissible state stored in sessionStorage (persists page refreshes)
  • Use theme.json shadow and border radius
  • Smooth animations using theme custom properties

Acceptance Criteria

  • 6 alert variants with appropriate colors
  • Optional icon displayed
  • Title and content areas
  • Dismiss button when enabled
  • Smooth fade-out animation on dismiss
  • All variants meet WCAG AA contrast
  • Uses theme.json design tokens

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureIntroduce a new FeatureblocksCustom block developmentphase-4Custom Blockspriority: medium🟡 Moderate importance - can be scheduled

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions