localgovdrupal / localgov_base

The base theme for LocalGov Drupal websites.
8 stars 15 forks source link

Adds icons for callouts and alerts #562

Open markconroy opened 4 months ago

markconroy commented 4 months ago

Closes #531

Here's a PR to add an icon to alerts and callouts. Just to note a few things:

  1. This is a change that councils may not be expecting
  2. Are we sure callouts AND alerts should have an icons, not just alerts?
  3. Some councils may have already implemented a similar fix like this already, so this might affect what they have done.

Let's make sure we have these as notes in the release notes. Here's a screenshot.

Screenshot 2024-06-12 at 16 37 05

=== Thanks to Big Blue Door for sponsoring my time to work on this.

msayoung commented 4 months ago

Are we sure callouts AND alerts should have an icons, not just alerts?

There's an argument to add them to the ones named callout danger, and callout success - however the others could be used in all sorts of ways, so I guess maybe not.

Other thoughts:

In the gov.uk pattern https://design-system.service.gov.uk/components/warning-text/ there is visually-hidden text "Warning" which will convey a similar message to non-visual users.

As we're just working with the css, we could potentially add "Warning" as content in the ::before

However, is "warning" always appropriate? Perhaps I'm overthinking this.

Related: https://github.com/localgovdrupal/localgov_base/issues/563

markconroy commented 4 months ago

Given that these are wysiwyg styles, it's tricky to add the visually hidden text. I guess we could do it with JS. This might be more a feature for the alerts than the callouts though, as they are "alerts" rather than "here's a bit of info we want to make look different".

anthonylindsay commented 3 months ago

Presumably, given the intent is to convey information here, the icon should be paired to the colour/state? So an 'info' alert might have one icon, and a 'panic' alert might have another? Otherwise we're back to using colour to convey meaning without a supplemental method.