Sha256: 85359a1df63da1f2f3b485a66d59f5a6037b4eb9f43e2afe819cdffc1b95b3da

Contents?: true

Size: 989 Bytes

Versions: 62

Compression:

Stored size: 989 Bytes

Contents

/*------------------------------------*\
    #SVG
\*------------------------------------*/

/// Adds supportive styles for incluing an SVG via CSS.
///
/// @param {Path} $image - the partial path of the image, relative to
///     image directory and engine path's root
/// @param {Dimension} $width - the width of the UI
/// @param {Dimension} $height [nil] - the height of the UI, if `nil` `$height`
///     will default to `$width`
/// @param {Color} $bg-color [$tranparent]- the background color of the UI
///
/// @example scss - SVG mixin
///     .block {
///         @include svg(image.svg, 24px);
///     }
@mixin svg($image, $width, $height: nil, $bg-color: $transparent) {
    @if ($height == nil) { $height: $width; }
    display: block;
    text-indent: 200%;
    width: $width;
    height: $height;
    background: $bg-color;
    white-space: nowrap;
    background-image: image-url("workarea/storefront/#{$image}");
    background-size: $width $height;
    overflow: hidden;
}

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-storefront-3.5.27 app/assets/stylesheets/workarea/storefront/tools/_svg.scss
workarea-storefront-3.5.26 app/assets/stylesheets/workarea/storefront/tools/_svg.scss
workarea-storefront-3.4.45 app/assets/stylesheets/workarea/storefront/tools/_svg.scss
workarea-storefront-3.5.25 app/assets/stylesheets/workarea/storefront/tools/_svg.scss
workarea-storefront-3.5.23 app/assets/stylesheets/workarea/storefront/tools/_svg.scss
workarea-storefront-3.4.44 app/assets/stylesheets/workarea/storefront/tools/_svg.scss
workarea-storefront-3.5.22 app/assets/stylesheets/workarea/storefront/tools/_svg.scss
workarea-storefront-3.4.43 app/assets/stylesheets/workarea/storefront/tools/_svg.scss
workarea-storefront-3.5.21 app/assets/stylesheets/workarea/storefront/tools/_svg.scss
workarea-storefront-3.4.42 app/assets/stylesheets/workarea/storefront/tools/_svg.scss
workarea-storefront-3.5.20 app/assets/stylesheets/workarea/storefront/tools/_svg.scss
workarea-storefront-3.4.41 app/assets/stylesheets/workarea/storefront/tools/_svg.scss
workarea-storefront-3.5.19 app/assets/stylesheets/workarea/storefront/tools/_svg.scss
workarea-storefront-3.4.40 app/assets/stylesheets/workarea/storefront/tools/_svg.scss
workarea-storefront-3.5.18 app/assets/stylesheets/workarea/storefront/tools/_svg.scss
workarea-storefront-3.4.39 app/assets/stylesheets/workarea/storefront/tools/_svg.scss
workarea-storefront-3.5.17 app/assets/stylesheets/workarea/storefront/tools/_svg.scss
workarea-storefront-3.4.38 app/assets/stylesheets/workarea/storefront/tools/_svg.scss
workarea-storefront-3.5.16 app/assets/stylesheets/workarea/storefront/tools/_svg.scss
workarea-storefront-3.4.37 app/assets/stylesheets/workarea/storefront/tools/_svg.scss