Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

outputStyle: "compressed" not playing nicely with sass list string #1701

Closed
marker004 opened this issue Nov 5, 2015 · 4 comments
Closed

Comments

@marker004
Copy link

I'm generating css for a bunch of different color styles (.is-red, .is-yellow, .is-purple, etc...). I made a sass list and parse through it like such:

$colors-list: candy-blue $candy-blue $candy-blue-active $candy-blue-tint, grass-green $grass-green $grass-green-active $grass-green-tint, purple $purple $purple-active $purple-tint, red $red $red-active $red-tint, pink $pink $pink-active $pink-tint, orange $orange $orange-active $orange-tint, royal-blue $royal-blue $royal-blue-active $royal-blue-tint, lime-green $lime-green $lime-green-active $lime-green-tint, yellow $yellow $yellow-active $yellow-tint

@each $current-color in $colors-list
.is-#{nth($current-color, 1)} &
  .color-bar
    background-color: #{nth($current-color, 2)}
  .blog__title,
  .blog__author
    a
      border-color: #{nth($current-color, 2)}
      &:hover
        background-color: #{nth($current-color, 4)}

All the color variables are defined and working properly on their own.

And here's the relevant part of my Gruntfile.coffee section:

 sass:
  dist:
    options:
      outputStyle: 'compressed'

Anyway, things work great when I have outputStyle set as "expanded" or "compact". But when outputStyle is "compressed" it will not generate the css for "yellow" and only for "yellow", strangely enough. It doesn't matter what order it is in the color list either, as I've tested moving it to the beginning and the middle of the list. It really just seems to be the string "yellow" as the first part of the list item, because I also tested changing that to something else ("real-yellow") and that worked fine. Any thoughts? Surely "yellow" isn't a reserved word?

@randallmeeker
Copy link

I'm getting a different symptom, but same thing. When I do compressed the following class name .something-white will get turned into .something-#fff

@randallmeeker
Copy link

@randallmeeker
Copy link

In my case I found if needed to enclose the string in quotes to be fixed.
http://sassmeister.com/gist/df83bf821ef3a65b6283

@mgreter
Copy link
Contributor

mgreter commented Nov 7, 2015

Please include at least the versions you are using. I cannot reproduce the original report, I just get Undefined variable: "$candy-blue" and I also cannot reproduce the second one by @randallmeeker with latest ruby sass (3.4.19). Please provide self-contained examples, so we can actually reproduce the same results!? Please re-open if you can re-produce with latest versions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants