One File named like a color caused an error (only colorname yellow) #1031

BernhardBezdek opened this Issue Sep 24, 2012 · 2 comments

3 participants


I've found a bug with enabled option "output_style = :compressed".
I have a sprite set with files named like colors.

Testing case:
output_style = :compressed
(Rest like its defaults)

@import "compass";

@import "rawimages/*.png";
@include all-rawimages-sprites ;

border:solid 2px #000;

images/rawimages folder contains:

  • green.png
  • blue.png
  • red.png
  • yellow.png

Works fine with noncompressed files but if I enable compression yellow is parsed like this:

background:url('/SASSCOMPASS/img/rawimages-sb3b538c306.png') no-repeat

Instead of .rawimages-yellow it parses .rawimages-#ff0 (Hex Representation of yellow) but only at this one color.

@scottdavis scottdavis was assigned Oct 20, 2012

This bug is not restricted to filenames. I have following code

$colors: red #f00, yellow #ff0, green #0f0, blue #00f;
@each $entry in $colors {
    $name: nth($entry, 1);
    $color: nth($entry, 2);

    .box-#{$name} > header {
         background: $color;

Which works fine as long as I do not generate compressed output. With -output_style compressed the yellow class is missing in the generated CSS.

My workaround was to put yellow in quotes ("yellow") which surprisingly works.

@scottdavis scottdavis closed this Mar 15, 2013
Compass member

Some color names are reserved in sass for example when i try to assign that list as you have above

>> $colors: red #f00, yellow #ff0, green #0f0, blue #00f
(red red, yellow yellow, green lime, blue blue)
Using quotes around the color name is the correct thing to do if you are wanting this functionality.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment