Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Follow-up to #2424587: Make the mobile breakpoint for Bartik empty
Problem/Motivation
I set up a responsive image style using thumbnail for the mobile breakpoint (which has an empty mediaQuery). When I set article image to use the responsive image style and then created an article with a test image, the source element for the mobile breakpoint had an empty media attribute.
Comment | File | Size | Author |
---|---|---|---|
#11 | interdiff-7-11.txt | 1.64 KB | Jelle_S |
#11 | 2424727-11-resp-img-no-empty-media-attr.patch | 4.82 KB | Jelle_S |
Comments
Comment #1
attiks CreditAttribution: attiks commentedComment #2
Jelle_SEt voilà ;-)
Comment #3
Wim LeersSorry.
Comment #4
attiks CreditAttribution: attiks commented#3 ++
Comment #5
Jelle_S#3 & #4: LOL, yeah, I figured as soon as I posted it, so I already started on it. Here it is with tests included.
Comment #6
attiks CreditAttribution: attiks commentedtypo formattes?
typo ImgStyle?
Comment #7
Jelle_SComment #8
attiks CreditAttribution: attiks commented1 out of 2 isn't bad ;-)
RTBC is bot is happy
Comment #10
Wim LeersNit: the $image_uri line is misplaced. Copy/paste error? Let's put it (and its comment) a bit lower, where it logically belongs.
Comment #11
Jelle_SAh yes, that comment was totally irrelevant. It was indeed a copy-paste error.
Comment #12
Wim LeersComment #15
Wim LeersComment #16
alexpottIs it realistic for breakpoints to not have a media query?
Comment #17
alexpottSetting to 'needs review' to get an answer to #16
Comment #18
attiks CreditAttribution: attiks commented#16 It is, mainly for the mobile breakpoint
Comment #19
Wim LeersTo clarify #18: the "narrowest" breakpoint has an empty media query. IOW: it's the default. Then for each breakpoint that is wider, a media query is set.
Back to RTBC since #18 answers #16.
Comment #20
RainbowArrayTo further clarify, an empty media attribute is useful when using the sizes and srcset attribute, because sizes is used for viewport switching of images rather than a media query filling that role.
Comment #21
alexpottThis issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 097d6d3 and pushed to 8.0.x. Thanks!