Since the 1.15.2 update, it is now impossible to define images styles specifically for small screens.

According to the DSFR documentation, this is what the breakpoint ui_suite_dsfr.screen-xs-max was supposed to be used for.
In my opinion it's the only "max-width" breakpoint that we need, since we use the fallback style for browsers that do not support the WEBP format (and not for the small screens).

Could we please bring it back?

Command icon 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:

Comments

spryah created an issue. See original summary.

just_like_good_vibes’s picture

Hello spryah,
we only recently introduced the breakpoints in the theme. what impossibility do you refer to ?
you mean there is a missing breakpoint in the ones that were introduced?

The breakpoints are mobile-first on purpose: each one starts at a DSFR width and applies to everything above it. You are right that nothing covers screens under 576px, so small screens only get the fallback image style, without multipliers.

would you tell us more about your exact case please ? Which responsive image style and mappings did you use with screen-xs-max, and was it combined with the other breakpoints or used alone?

We could add a base breakpoint with an empty media query, at the lowest weight, rather than bringing back a max-width one. It applies to all screens, so in a picture it catches everything the larger breakpoints don't, which is small screens. Used alone, it gives a plain img with srcset. It also follows DSFR, where XS is the default with no media query. Would that work for you?

spryah’s picture

Hi there!
Sorry, brain broke after reading only the second MR.
We were using our own theme breakpoint file before this one was added, then we decided to use the new ui_suite_dsfr breakpoint file and found out that a "base" option was missing.

Here's an example of how we proceed for a 16:9 image in a 792px container:

  • Base or XS: 541x304 / resize & crop / convert to WebP (small screens or generic)
  • MD up: 792x446 / resize & crop / convert to WebP (larger screens)
  • Fallback: 792x446 / resize & crop / no conversion (older browsers)

In the way we proceed, the "fallback" option should not be used for small screens as it would lead to inconsistent behaviors in older browsers. Instead, we add a "base" option for small screens, without any media query definition, and we use the "fallback" option for browsers that do not support responsive format, and by extension, the WebP format.

As opposed to previously stated, no "max-width" option should be used.

Would that work for you?

spryah’s picture

Title: Missing XS breakpoint » Missing "base" breakpoint

spryah’s picture

Status: Active » Needs review
just_like_good_vibes’s picture

Assigned: Unassigned » just_like_good_vibes

Thanks Soryah for proposing the code i will review and merge soon.

just_like_good_vibes’s picture

Assigned: just_like_good_vibes » Unassigned
Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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