stylesheets/toolkit/_pe.scss in toolkit-0.1.13 vs stylesheets/toolkit/_pe.scss in toolkit-0.1.14

- old
+ new

@@ -12,15 +12,22 @@ //////////////////////// // Degrade From // // - $feature: Modernizr feature (base CSS class name) //////////////////////// -@mixin degrade-from($feature) { - .no-#{$feature} &, - .no-js & { - @content; +@mixin degrade-from($feature, $no-js: true) { + @if $feature == 'js' or not $no-js { + .no-#{$feature} & { + @content; + } } + @else { + .no-#{$feature} &, + .no-js & { + @content; + } + } } //////////////////////// // Progressive Enhancement Text Replace Mixin // @@ -28,17 +35,18 @@ // - $sprite: The name of the sprite you want to use (this is the file name without extension) // - $inline-svg: Switches between a Base64 encoded SVG or a normal url() for the SVG. Default to true // - $with-dimensions: Switches between including dimensions (height/width for all and background-size for SVG) or not. Defaults to true. // - $inline: Whether or not the containing selector is an inline element. Defaults to false. //////////////////////// -@mixin replace-text-pe($png-path, $sprite, $inline-svg: true, $with-dimensions: true, $inline: false) { +@mixin replace-text-pe($img-path, $sprite, $inline-svg: true, $with-dimensions: true, $inline-element: false) { // Map Out the Sprite - @debug $png-path + '*.png'; + $png-path: $img-path + '/*.png'; $sprite-map: sprite-map($png-path); // Build SVG file name - $svg-file: str-replace('*.png', '#{$sprite}.svg', $png-path); +// $svg-file: str-replace('*.png', '#{$sprite}.svg', $png-path); + $svg-file: $img-path + '/#{$sprite}.svg'; // Default Sprite File $sprite-file: '' !default; @if $with-dimensions { @@ -49,11 +57,11 @@ width: image-width($sprite-file); height: image-height($sprite-file); } // Hide text. Use squish-text() if the element is inline - @if $inline { + @if $inline-element { @extend %replace-text-pe-squish; } @else { @extend %replace-text-pe-hide; } @@ -89,10 +97,11 @@ // // Need a custom mixin to create extendable classes classes for background image for sprites because dynamic mixin names don't work. // // - $png-path: The path to the pngs for the image sprite, including the *.png (just like normal image sprites) ////////////////////////////// -@mixin sprite-map-generator($png-path) { +@mixin sprite-map-generator($img-path) { + $png-path: $img-path + '/*.png'; $png-path: sprite-map($png-path); %#{sprite-map-name($png-path)}-image-map { background: { image: $png-path; repeat: no-repeat; \ No newline at end of file