Make WordPress Core

Changeset 58135


Ignore:
Timestamp:
05/12/2024 09:27:02 AM (2 weeks ago)
Author:
karmatosed
Message:

Twenty Seventeen: Resolves Header Image Quality Issue

The heading image had quality issues on iOS Safari in portrait and landscape modes. This resolves it through adding 200cv for smaller screens so less than full size.

Props poena, richardevs, laurelfulford, davidakennedy, joemcgill, SergeyBiryukov, ianbelanger, sabernhardt, shailu25, robertghetau.
Fixes #39253.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyseventeen/functions.php

    r57886 r58135  
    581581 *
    582582 * @since Twenty Seventeen 1.0
     583 * @since Twenty Seventeen 3.7 Added larger image size for small screens.
    583584 *
    584585 * @param string $html   The HTML image tag markup being filtered.
     
    589590function twentyseventeen_header_image_tag( $html, $header, $attr ) {
    590591    if ( isset( $attr['sizes'] ) ) {
    591         $html = str_replace( $attr['sizes'], '100vw', $html );
     592        $html = str_replace( $attr['sizes'], '(max-width: 767px) 200vw, 100vw', $html );
    592593    }
    593594    return $html;
Note: See TracChangeset for help on using the changeset viewer.