Skip to content

[FIX] UI: card images do not span the whole card - #12566

Open
chfsx wants to merge 1 commit into
ILIAS-eLearning:release_12from
srsolutionsag:fix/12/card-image-link-width
Open

chfsx wants to merge 1 commit into
ILIAS-eLearning:release_12from
srsolutionsag:fix/12/card-image-link-width

Conversation

@chfsx

@chfsx chfsx commented Dec 3, 2026

Copy link
Copy Markdown
Member

Since dd9316b ("[FEATURE] UI: add Listing\Inline and Listing\Entity\Grid components", #11444) a link around an image is displayed inline-block:

a:has(img) {
	display: inline-block;
	...
}

In a card, the link in .il-card-image-container therefore shrinks to the width of the image. .il-card img.img-responsive { width: 100% } then refers to this link instead of the card, so tile images (IRSS flavours) are shown smaller than the card. SVG default tile images are not affected because they scale. In addition, loadHighResolutionSource() measures the width of the (too small) image and therefore loads a smaller source than needed.

Measured on a local 12 installation (category in tile view, window width 1280px): card 277px, tile image 240px. With this change the image is 277px wide and the 480px source is loaded; also checked at 800px and 1600px and in Safari.

This sets the link in the image container of a card to display: block. The global rule stays untouched. delos.css was compiled with sass 1.94.2; the only other difference of a full compile (one colour notation from an earlier compile with another sass version) is not part of this PR.

trunk has the same code and needs the same change.

Since dd9316b a link around an image is displayed inline-block
(a:has(img)). In a card the link around the image therefore shrinks to the
width of the image, so width: 100% of the image no longer refers to the card
and tile images from the IRSS are shown smaller than the card. The responsive
image then also measures this smaller width and loads a smaller source.

The link in the image container of a card is displayed as block again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants