ahebrank/emergency_alerts

Changing severity classes

Closed this issue · 2 comments

Is it possible to change the classes for the severity of the alert (e.g. .announcement)? I'm working on a project that requires BEM classes, so rather than .announcement, it'd have to be .emergency-alert--announcement. A pain, I know!

If you override the template in your theme, here's a quick tweak:

{%
  set classes = [
    'emergency-alert',
    'emergency-alert--' ~ alert_level,
    (alert_level == 'announcement')? 'closeable'
  ]
%}

We'll pretty much always override this template depending on what front end framework provides the alert styling.

D'oh — trust me to miss that! Thanks, Andy.