Provide a basic replacement for Classy's messages library in the Payment module

Created on 5 September 2023, about 1 year ago
Updated 17 November 2023, 10 months ago

Drupal 10 removed the Classy module from core, but at least two payment gateway modules depended on classy/messages to style error messages returned from JavaScript API requests. Those modules are now D10 incompatible, but simply removing the CSS library means those messages are unstyled.

It seems we have two options:

  1. Those modules includes the styles themselves.
  2. We provide the styles in Commerce Core instead.

Even though imperfect, I favor the second option. We already have a pattern of generic Classy styling usage, so it breaks nothing for us to perpetuate that from Commerce Core. It's possible other modules are using the library in non-payment contexts, in which case we could put the styles into the Commerce module instead of Payment.

However, for now, my proposal is to:

  1. Define a payment-messages library in the Payment module.
  2. Copy the CSS file from the D9 Classy module.
  3. Prepend payment- to the class names, so messages becomes payment-messages, messages--error becomes payment-messages--error, etc.

For D10 compatibility then, those modules would depend on this new library instead and revise their classes accordingly.

๐Ÿ“Œ Task
Status

Fixed

Version

2.0

Component

Payment

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States rszrama

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

Comments & Activities

Production build 0.71.5 2024