jedfoster / SassMeister

The Sass playground
http://sassmeister.com
198 stars 25 forks source link

array key color name being converted in compressed mode only #189

Closed blunket closed 7 years ago

blunket commented 7 years ago

the following Sass compiles differently in compressed mode than it does in compact mode:

$colors : (
    orange  : #f26221,
    yellow  : #fcb825,
    cyan    : #00aeef,
);

// default: orange
body.page {
  #info-bar {
    background-color: map-get($colors, orange);
  }
}

// other page themes
@each $color, $hex in $colors {
  body.page.theme_#{$color} {
    #info-bar {
      background-color: map-get($colors, $color);
    }
  }
}

With compact mode I get the resulting CSS that I expect:

body.page #info-bar { background-color: #f26221; }
body.page.theme_orange #info-bar { background-color: #f26221; }
body.page.theme_yellow #info-bar { background-color: #fcb825; }
body.page.theme_cyan #info-bar { background-color: #00aeef; }

However, the word "yellow" gets converted to #ff0 when in compressed mode. The class names are all messed up here:

body.page #info-bar{background-color:#f26221}body.page.theme_orange #info-bar{background-color:#f26221}body.page.theme_#ff0 #info-bar{background-color:#fcb825}body.page.theme_cyan #info-bar{background-color:#00aeef}
xzyfer commented 7 years ago

See https://github.com/sass/libsass/issues/2409

blunket commented 7 years ago

Woops, looks like it's already known