Problem/Motivation

Claro's image-widget library is not actually loaded. It extend's Classy's image-widget library, but Classy doesn't actually load that library
as noted in its image-widget.css

* This CSS file is not used in this theme (Classy). It was intended to be used,
 * but due to a bug, Drupal 8 shipped with it not being used. To not break
 * backwards compatibility, we continue to not load it in Classy. Every
 * subtheme of Classy is encouraged to use it, by attaching the
 * classy/image-widget asset library in their image-widget.html.twig file.

Claro's image-widget.html.twig file does not load this. Library,

Were the claro/image-widget library to actually load, it loads a css file that has one rule with the selector .image-widget-data, a selector that doesn't exist in Claro due to it overriding Classy's image-widget.html.twig

Proposed resolution

Remove Classy's image-widget library and associated assets. If this is too much of a BC concern, it should be deprecated.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bnjmnm created an issue. See original summary.

kostyashupenko’s picture

Version: 8.9.x-dev » 9.0.x-dev
kostyashupenko’s picture

Status: Active » Needs review
FileSize
5.01 KB

Some assets already were removed here https://git.drupalcode.org/project/drupal/-/commit/458e132a8cfb08addb051...

What was done now:
1. removed `claro/image-widget` library, since it is not used and looks like guys forgot to remove it in commit above or idk :)
2. removed `classy/image-widget` library and classy's assets
3. `core/themes/seven/css/classy/components/image-widget.css` moved to just components `core/themes/seven/css/components/image-widget.css`
4. renamed `seven/classy.image-widget` library to `seven/image-widget`

Status: Needs review » Needs work

The last submitted patch, 3: 3109351-3.patch, failed testing. View results

bnjmnm’s picture

+++ b/core/themes/claro/claro.libraries.yml
@@ -165,12 +165,6 @@ media-form:
-image-widget:
-  version: VERSION
-  css:
-    component:
-      css/layout/image-widget.css: {}
-

This is the only change in the patch that is needed to complete this issue. Changes outside of the Claro theme are not in scope for this issue, nor are they desired changes. Provide another patch with just this change and this should be good. The tests will also pass, as they were failing due to changes made in other themes.

neelam_wadhwani’s picture

Assigned: Unassigned » neelam_wadhwani
neelam_wadhwani’s picture

Assigned: neelam_wadhwani » Unassigned
FileSize
428 bytes
3.75 KB

Hello @bnjmnm
I have updated the patch and reroll it.
Kindly review it.

neelam_wadhwani’s picture

Status: Needs work » Needs review
Kristen Pol’s picture

Thanks for the patch.

1) Patch applies cleanly:

[mac:kristen:drupal-9.0.x-dev]$ patch -p1 < 3109351-7.patch 
patching file core/themes/claro/claro.libraries.yml

2) The patch removes the image-widget library, and only affects Claro.

3) Searching Claro after the patch is applied shows image-widget still referred to here:

core/themes/claro/css/components/image-preview.pcss.css:.image-widget .file.file {
core/themes/claro/css/components/image-preview.css:.image-widget .file.file {

Should this remain?

Kristen Pol’s picture

Status: Needs review » Reviewed & tested by the community

After reading the comments above again, per my review in #9 and the comment in #5, I'm going to mark this RTBC.

lauriii’s picture

Title: Remove or at least deprecate image-widget library from Claro » Remove image-widget library from Claro

  • lauriii committed b927c36 on 9.1.x
    Issue #3109351 by neelam_wadhwani, kostyashupenko, bnjmnm, Kristen Pol:...

  • lauriii committed c8a9561 on 9.0.x
    Issue #3109351 by neelam_wadhwani, kostyashupenko, bnjmnm, Kristen Pol:...
lauriii’s picture

Status: Reviewed & tested by the community » Fixed

I think we can remove the library. I don't think we have to be too concerned of the BC implications of this issue because Claro is experimental theme, and it is not designed to be extended. The library is also not being loaded anywhere out of the box and it's hard to think of a reason anyone would depend on this library because it's just pointing to a non-existing CSS file.

Committed b927c36 and pushed to 9.1.x and 9.0.x. Thanks!

andypost’s picture

Issue tags: +Needs followup

To remove unused css file

Status: Fixed » Closed (fixed)

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