Skip to content

Conversation

@GeoffDusome
Copy link
Contributor

@GeoffDusome GeoffDusome commented Aug 28, 2025

What does this do/fix?

This pull request introduces a new "Announcements" block to the theme, providing both frontend and editor support for displaying site-wide announcements with configurable styles, dismiss functionality, and improved utility classes. It also includes supporting changes to styling utilities, icon variables, and PHPStan configuration.

Announcements Block Implementation:

  • Added a new tribe/announcements block, including registration (index.js), block metadata (block.json), server-side rendering (render.php), editor UI (edit.js), and frontend interactivity (view.js). The block supports themes, alignment, dismissibility, and call-to-action buttons. [1] [2] [3] [4] [5]
  • Registered the new block in the PHP block definer (Blocks_Definer.php).

Styling and Utility Enhancements:

  • Introduced new PCSS mixins and utility classes for button resets (actions/_mixins.pcss, actions/_utilities.pcss), and imported these utilities in the main utilities file. [1] [2] [3]
  • Added block-specific styles for the Announcements block for both frontend/editor and editor-only contexts (style.pcss, editor.pcss). [1] [2]

Design System Updates:

  • Added a new color variable for a darker error alert (color/_variables.pcss).
  • Added a new "dismiss" icon to the icon variables file, including SVG loading and CSS variable definition (icons/_variables.pcss).

Tooling:

  • Updated PHPStan configuration to exclude the theme's dist directory from static analysis.

These changes collectively enable a flexible, themeable announcements system with modern UX and maintainable code structure.

QA

Links to relevant issues

Screenshots/video:

@GeoffDusome
Copy link
Contributor Author

Just looking to get this merged into the feature branch so we can get started on hooking it up to BE.

Copy link
Collaborator

@dpellenwood dpellenwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One suggestion, then good to merge!

Comment on lines +5 to +7
$heading = 'Important Update';
$body = 'We’ve launched a new feature you should check out.';
$cta_label = 'Learn More';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably good to wrap this in a localization call by default.

@GeoffDusome GeoffDusome merged commit 404a5a3 into feature/announcements Sep 2, 2025
7 checks passed
@GeoffDusome GeoffDusome deleted the task/MOOSE-263/announcements-block branch September 2, 2025 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants