Media library browser spacing issues

Created on 28 March 2023, over 1 year ago
Updated 3 July 2024, 5 months ago

Problem/Motivation

Media entity browser does not have the correct spacing / alignment.
It goes slightly below the upper part of the modal and it's not horizontally aligned

Steps to reproduce

- Create site with a fresh install of Drupal (in my case 9.5.7)
- Install the gin theme & gin_toolbar module
- Install the media & media_library core modules
- Create one or more media types
- Create a media field that allows one media type and a field that allows multiple media types
- Create one page of the newly created content type and try adding a media entity with either of the fields created
- The media library browser modal will have negative spacing at top and be slightly misaligned horizontally

Proposed resolution

Override media-library-wrapper margin on a gin theme CSS file from the default:

margin: -1rem -1.5rem -1rem -1rem; that comes from the media_library.scss to margin: 0 -1.5rem 0 -1.5rem;

This though is not really a valid solution by itself, since it still won't position the content properly on the initial load, displaying a cropped top spacing due to JS

🐛 Bug report
Status

Closed: cannot reproduce

Version

3.0

Component

Code

Created by

🇪🇸Spain dabodia Valencia

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

Comments & Activities

Production build 0.71.5 2024