Background

Layout Builder Modal added administrative theme styling (Seven theme) via #3042907: Use admin theme for forms in July 2019. Since that time, the majority of the Seven CSS has remained unchanged. The exception is the Media Library CSS, a module which was marked as stable in November 2019. Along with the minor styling changes introduced during that time, the CSS itself was relocated from the Media Library module to Seven.

Problem/motivation

The current CSS in this module manifests a small visual regression when a Media Library element is used in Layout Builder Modal. In the context of updating an already added image, the media item label exceeds its container, and the remove button is positioned at the top right of the parent container

Current behavior:
Layout Builder Modal outside parent

Expected behavior:
Layout Builder Modal inside parent

Proposed resolution

1. Update media_library.scss to reference core/modules/media_library/css/media_library.theme.css, the new location of the Media Library CSS for the Seven theme.
2. Re-run the npm script to generate the appropriate CSS, wrapped in the #layout-builder-modal ID

I've verified that re-running the script *only* introduces changes in the resulting media_library.css file, indicating no changes have occurred in any of the other files this module's SCSS is referencing.

We should add a release note upon the next tagged version of Layout Builder Modal that this release should be used with sites on Drupal 8.8, while sites still running 8.7 should not update. Additionally, we can indicate this version constraint in the .info.yml file, if desired. Suggested release language:

Drupal 8.8.0 introduced a stable Media Library module, which includes some styling changes. Sites running versions of Drupal prior to this should remain on Layout Builder Modal 1.0. Sites that have updated to Drupal 8.8 should update to this release of Layout Builder Modal

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mark_fullmer created an issue. See original summary.

mark_fullmer’s picture

Status: Needs work » Needs review
FileSize
29.8 KB

The attached patch follows the proposed resolution, above. Namely, it:

1. Updates media_library.scss to reference core/modules/media_library/css/media_library.theme.css, the new location of the Media Library CSS for the Seven theme.
2. Re-ran the npm script to generate the appropriate CSS, wrapped in the #layout-builder-modal ID

Verification of the effect can be performed as follows:
1. Create a block type with a Media Library form element.
2. Add an inline block of this type to a page using Layout Builder in conjunction with Layout Builder Modal
3. Save the page
4. Enter layout mode and "Configure" the block, entering 'update' mode.
5. Verify that the Media Library preview renders as the "expected" image from the original issue above, rather than the "current" image.

mark_fullmer’s picture

Issue summary: View changes
mark_fullmer’s picture

Issue summary: View changes

  • mark_fullmer committed 9c4b556 on 8.x-1.x
    Issue #3113268 by mark_fullmer: Minor changes to Media Library CSS
    
mark_fullmer’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.