Add support for additional coloured notices

Created on 3 April 2024, 9 months ago
Updated 3 July 2024, 6 months ago

In drupal there are numerous notices.

e.g. MigrationInterface has the following status's

MESSAGE_INFORMATIONAL
MESSAGE_NOTICE
MESSAGE_WARNING
MESSAGE_ERROR

however claro only supports the following traffic light system namely

status - green
warning -amber
error - red

it would useful to add some additional notices

e.g.

info - blue
notice - greyblue

https://www.drupal.org/files/issues/2024-04-03/Screenshot%202024-04-03%2... โ†’
https://www.drupal.org/files/issues/2024-04-03/Screenshot%202024-04-03%2... โ†’

โœจ Feature request
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Claroย  โ†’

Last updated 2 days ago

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom 2dareis2do

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @2dareis2do
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom 2dareis2do
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom 2dareis2do

    Attached current colour pallete

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom 2dareis2do

    Current message styles in web/core/themes/claro/css/components/messages.pcss.css

    we also have respective foreground colours in web/core/themes/claro/css/theme/colors.pcss.css:

    .color-success {
      color: #325e1c;
      background-color: #f3faef;
    }
    .color-warning {
      color: #734c00;
      background-color: #fdf8ed;
    }
    .color-error {
      color: #a51b00;
      background-color: #fcf4f2;
    }
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom 2dareis2do

    screenshot of respective text styles, success, warning, error

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom 2dareis2do

    We can see each notice currently has an svg icon that work with a header e.g.

    <div class="messages messages--status">
      <div class="messages__header">
        <h2 id="x" class="messages__title">
          A simple "status" alertโ€”check it out!
        </h2>
      </div>
      <p>A simple "status" alertโ€”check it out!</p>
    </div>
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom 2dareis2do

    added new icons and colours - screenshot

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom 2dareis2do
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Environment: PHP 8.1 & MariaDB 10.3.22
    last update 9 months ago
    Custom Commands Failed
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom 2dareis2do
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom 2dareis2do
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom 2dareis2do

    Adding new patch with new text colours and icons, wile also updating notices

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom 2dareis2do

    updated styles for notifications including use of messages__content

  • Status changed to Needs review 7 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States xjm

    This would need approval from the Claro maintainers, so tagging. (It would also need to be a merge request rather than a patch, but best to wait to make sure the subsystem maintainers are on board first.) Thanks!

  • Status changed to Needs work 6 months ago
  • The Needs Review Queue Bot โ†’ tested this issue.

    While you are making the above changes, we recommend that you convert this patch to a merge request โ†’ . Merge requests are preferred over patches. Be sure to hide the old patch files as well. (Converting an issue to a merge request without other contributions to the issue will not receive credit.)

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia mithun s Bangalore

    Mithun S โ†’ made their first commit to this issueโ€™s fork.

  • Status changed to Needs review 6 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia mithun s Bangalore

    Created a MR for the issue out of the patch. Please review.

  • Pipeline finished with Failed
    6 months ago
    Total: 167s
    #196842
  • Status changed to Needs work 6 months ago
  • ๐Ÿ‡ช๐Ÿ‡ธSpain ckrina Barcelona

    Claro already has designs for the blue color, so you can you them for the implementation if you want: https://www.figma.com/design/OqWgzAluHtsOd5uwm1lubFeH/%F0%9F%92%A7-Drupa...

    The blue one is targeted to "Status" messages, where the system is informing of something beyond the warning/error/"succeed" type of message. That's why the icon is an "i": it's giving information. Using a bell for it seems more as a "notification" that you have to read, tied to other UI patterns we don't use here.

    On the other side, why do you want a gray message? What is its purpose? Which kind of information will it try to communicate? If it's just a communication, why can't it be blue? As a Claro maintainer, I'd love to see this backed with a need instead of opening the floor to any kind of color for messages.

    Also, to approve any UI work it would be good to see the messages working with the while interface, not a small piece of it.

    Thanks!

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom 2dareis2do

    Hi Chrina,

    Thats interesting that you already have designs for the blue colour notifications

    The additional colour suggestions were completely arbitrary.

    In this example we have the following:

    MESSAGE_WARNING => warning -amber
    MESSAGE_ERROR => error - red

    MESSAGE_INFORMATIONAL => ?
    MESSAGE_NOTICE => ?

    So I decided to come up with the following:

    .color-notice {
      color: var(--messages--notice-color);
      background-color: var(--messages--notice-color-bg);
    }
    .color-info {
      color: var(--messages--info-color);
      background-color: var(--messages--info-color-bg);
    }
    

    which map to:

    --messages--notice-color: #1a59b7;
    --messages--notice-color-bg: #edf8fd;
    --messages--info-color: #5aba26;
    --messages--info-color-bg: #ebfeee;
    

    From what I can seem, the actual implementation uses green as the status message, not blue.

Production build 0.71.5 2024