Sha256: baa1a0ea0e759bce9b3b35389818d77ad315ab8e2a3fabaa75d177b65f793ca2

Contents?: true

Size: 798 Bytes

Versions: 7

Compression:

Stored size: 798 Bytes

Contents

////
/// @group tools
////

// Disable indentation linting in this file only
// sass-lint:disable indentation

/// Image URL
///
/// If a custom image-url handler is defined ($govuk-image-url-function) then
/// it will be called, otherwise a url will be returned with the filename
/// appended to the image path.
///
/// @param {String} Filename for the image to load
/// @return {String} URL for the filename, wrapped in `url()`
/// @access public

@function govuk-image-url($filename) {
  $use-custom-function: variable-exists("govuk-image-url-function")
    and $govuk-image-url-function
    and function-exists($govuk-image-url-function);

  @if ($use-custom-function) {
    @return call($govuk-image-url-function, $filename);
  } @else {
    @return url($govuk-images-path + $filename);
  }
}

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
govuk_publishing_components-9.6.0 node_modules/govuk-frontend/tools/_image-url.scss
govuk_publishing_components-9.5.3 node_modules/govuk-frontend/tools/_image-url.scss
govuk_publishing_components-9.5.2 node_modules/govuk-frontend/tools/_image-url.scss
govuk_publishing_components-9.5.1 node_modules/govuk-frontend/tools/_image-url.scss
govuk_publishing_components-9.5.0 node_modules/govuk-frontend/tools/_image-url.scss
govuk_publishing_components-9.4.0 node_modules/govuk-frontend/tools/_image-url.scss
govuk_fe_assets-0.1.0.pre.alpha node_modules/govuk-frontend/tools/_image-url.scss