You are here

function picture_get_multiplier_media_query in Picture 7

Generates the media query for multipliers of an image

Parameters

$multiplier: A string containing the multiplier for which the media query is for.

$breakpoint: A string containing the breakpoint media query.

Return value

sting The sting containing the media query for the multiplier.

File

./picture.module, line 1064
Picture formatter.

Code

function picture_get_multiplier_media_query($multiplier, $breakpoint) {
  $media_query = $breakpoint;
  if ($multiplier != '1x') {
    $multiplier_formatted = str_replace('x', '', $multiplier);
    if (variable_get('picture_implementation', PICTURE_IMPLEMENTATION_DEFAULT) === PICTURE_IMPLEMENTATION_PICTUREFILL2) {
    }
    else {
      $media_query = $breakpoint . ' and (min-device-pixel-ratio: ' . $multiplier_formatted . '), ';
      $media_query .= $breakpoint . ' and (-o-min-device-pixel-ratio: ' . $multiplier_formatted . '), ';
      $media_query .= $breakpoint . ' and (-webkit-min-device-pixel-ratio: ' . $multiplier_formatted . '), ';
      $media_query .= $breakpoint . ' and (min-resolution: ' . $multiplier_formatted . 'dppx)';
    }
  }
  return $media_query;
}