Sha256: d634d98444b90829fd1f073c98b58bc3f9815531e6564cee4f2dab91181dcf14

Contents?: true

Size: 1.12 KB

Versions: 25

Compression:

Stored size: 1.12 KB

Contents

////
/// @group helpers
////

/// Media query for retina images (device-pixel-ratio)
///
/// @param {Number} $ratio [2] - Device pixel ratio
/// @content Passed content will be outputted within the media query
///
/// @example scss - Providing a @2x image for screens that support it
///   background-image: govuk-image-url("my-image.png");
///
///   @include govuk-device-pixel-ratio {
///     background-image: govuk-image-url("my-image-2x.png");
///   }
///
/// @example scss - Using a custom ratio
///   background-image: govuk-image-url("my-image.png");
///
///   @include govuk-device-pixel-ratio {
///     background-image: govuk-image-url("my-image-2x.png");
///   }
///
///   @include govuk-device-pixel-ratio(3) {
///     background-image: govuk-image-url("my-image-3x.png");
///   }
///
/// @access public

@mixin govuk-device-pixel-ratio($ratio: 2) {
  // stylelint-disable indentation
  @media only screen and (-webkit-min-device-pixel-ratio: $ratio),
    only screen and (min-resolution: #{($ratio * 96)}dpi),
    only screen and (min-resolution: #{$ratio}dppx) {
      @content;
    }
}

/*# sourceMappingURL=_device-pixels.scss.map */

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
govuk_publishing_components-39.2.5 node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss
govuk_publishing_components-39.2.4 node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss
govuk_publishing_components-39.2.3 node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss
govuk_publishing_components-39.2.2 node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss
govuk_publishing_components-39.2.1 node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss
govuk_publishing_components-39.2.0 node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss
govuk_publishing_components-39.1.0 node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss
govuk_publishing_components-39.0.0 node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss
govuk_publishing_components-38.4.2 node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss
govuk_publishing_components-38.1.1 node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss
govuk_publishing_components-38.1.0 node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss
govuk_publishing_components-38.0.1 node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss
govuk_publishing_components-38.0.0 node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss
govuk_publishing_components-37.10.0 node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss
govuk_publishing_components-37.9.1 node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss
govuk_publishing_components-37.9.0 node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss
govuk_publishing_components-37.8.1 node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss
govuk_publishing_components-37.8.0 node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss
govuk_publishing_components-37.7.1 node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss
govuk_publishing_components-37.7.0 node_modules/govuk-frontend/govuk/helpers/_device-pixels.scss