Problem/Motivation
The sidebar in the Add or select Media Library widget is missing the proper styling in 10.2.x-dev and 11.x-dev:

In 10.1.x the styling looks correct:

Steps to reproduce
1. Add a media field to a content type.
2. Add two or more media types as reference type for the added media field.
3. Create a node for that content type
4. Attempt to attach a media item to the field.
5. The Media Library "widget" View will display. The left sidebar, showing the available media types, does not display the previous horizontal separators.
Proposed resolution
Restore vertical tabs CSS custom properties to core/themes/claro/css/base/variables.pcss.css from core/themes/claro/css/components/vertical-tabs.pcss.css. Add comments documenting that the propertiers are used by both vertical tabs and media library. See #8
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|
Issue fork drupal-3394048
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3394048-drupal-10.2-regression
changes, plain diff MR !6327
- 10.2.x
compare
- 11.x
compare
Comments
Comment #2
mark_fullmerComment #4
sandeep sanwale commentedIn claro theme the base folder contains variable.pcss.css file which have root variables for other css files where variables for verticle tabs were missing which i have add it through this patch .
Comment #6
daddison commentedThe patch in #4 applies to 10.2.2 and restores the proper styling.
Comment #7
godotislateThe target branch should be set back to 11.x. Committers will backport to 10.2 if possible.
Also, some questions were raised in #3404866: Media Type links in Media Library modal missing vertical tabs styling in Claro which turned out to be a duplicate of this issue:
#50
Possible paths forward:
Comment #8
ckrinaThe bug was introduced trying to follow the pattern to moving the variables to its own component without knowing they would be needed by another one (Media Library). And with this changes we're getting back to the point were variables that belong to a component are on base.
The ideal solution would the one were the 2 components are really the same, but that's not doable. The second ideal solution would be to make these variables name generic enough to be used in two different components, but I'm afraid it might lead to some bikeshedding in the issue (naming tends to bring that).
So I'd focus on preventing it happens again apart from fixing the bug. I would recommend to to add a comment on the variables block that explains those variables are needed in 2 places, both Vertical Tabs and Media Library.
Comment #9
godotislateAdded commit to MR with comment per #8 and removed properties from vertical tabs files.
Pinged in slack for a MR target change to 11.x
Comment #12
godotislateComment #13
djsagar commentedHi all,
Steps to reproduce for the issue.
1. Drupal Version 11.x
2. Administration theme Claro
3. Add a media field to a content type.
4. Add two or more media types as reference type for the added media field.
5. Create a node for that content type
6. Attempt to attach a media item to the field.
7. Applied MR !6327
Result:

Before MR
After MR

RTBC ++
Comment #14
djsagar commentedComment #15
praveenpb commentedComment #16
duaelfrI can confirm that the proposed patch/MR fixes the issue.
I agree with @ckrina that this is not the ideal solution, though. I wonder if it wouldn't be better to create a new library for vertical-tabs styling and make both vertical tabs and media library libraries depend on it. Any thoughts, boss? :)
Comment #20
lauriiiLooks like the bug is fixed and #8 has been addressed. Would be nice for sure to have a common component between these two use cases but it doesn't have to happen here.
Committed 89fde7a and pushed to 11.x. Also cherry-picked to 10.2.x. Thanks!
Comment #22
idebr commentedThis issue was released in Drupal 10.2.4, see https://www.drupal.org/project/drupal/releases/10.2.4