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

Ruby-Sass converts color values to shorter representations, LibSass doesn't #47

Closed
bittner opened this issue Nov 1, 2015 · 10 comments
Closed

Comments

@bittner
Copy link

bittner commented Nov 1, 2015

I've just switched from gulp-ruby-sass to gulp-sass, simply for the issue of CSS inline imports (sass/#556, sass-loader/#101). And, yes, inline-importing CSS files works like a charm with the LibSass-based implementation. This is one "incompatibility". 😏

Comparing the generated CSS I see that the LibSass-generated file is slightly bigger, because of color values that are kind if "minified" by the Ruby implementation, whereas with LibSass they remain as they are in the original source file (.sass), e.g.

original = LibSass --> Ruby-Sass

  • #ffffcc --> #ffc
  • #CC0000 --> #c00
  • #FF0000 --> red
  • #AAAAAA --> #aaa
  • #99CC66 --> #9c6
  • #FF6600 --> #f60
  • #CC3300 --> #c30
  • #330099 --> #309
  • #336666 --> #366
  • #003333 --> #033
  • #CC3300 --> #c30

Interestingly, not all color values are converted, some remain unchanged, e.g.

  • #FFCCCC (but this occurs in a background-color, not in color)
  • #006699 (color)
  • #00AA88 (color)
  • #CC0000 (color, even though converted earlier in the document in a border -- see above)

Is this an incompatibility I'm supposed to give notice about, or is this behavior maybe configurable in LibSass? I'd love to see the output matching completely.

@KittyGiraudel
Copy link
Owner

Ping @xzyfer for opinion. :)

@xzyfer
Copy link
Contributor

xzyfer commented Nov 6, 2015

LibSass does do this. Like Ruby sass it only happens in compressed mode. In
other modes it substitutes color values for names if possible.
On 6 Nov 2015 10:12 pm, "Hugo Giraudel" notifications@github.com wrote:

Ping @xzyfer https://github.com/xzyfer for opinion. :)


Reply to this email directly or view it on GitHub
#47 (comment)
.

@KittyGiraudel
Copy link
Owner

Soooo no incompatibility, right?

@xzyfer
Copy link
Contributor

xzyfer commented Nov 6, 2015

Not as far as I know.
On 6 Nov 2015 10:31 pm, "Hugo Giraudel" notifications@github.com wrote:

Soooo no incompatibility, right?


Reply to this email directly or view it on GitHub
#47 (comment)
.

@KittyGiraudel
Copy link
Owner

Closing then, thanks!

@bittner
Copy link
Author

bittner commented Nov 6, 2015

Sorry, but this is not true. My observation is about compressed mode. You have to reopen this bug. Sass packages involved are:

├─┬ gulp-sass@2.1.0
│ ├─┬ node-sass@3.4.1

@xzyfer
Copy link
Contributor

xzyfer commented Nov 6, 2015

Please provide a sassmiester gist showing an example. The code for this
definitely exists but it's entirely possible there is a bug.
On 7 Nov 2015 1:58 am, "Peter Bittner" notifications@github.com wrote:

Sorry, but this is not true. My observation is about compressed mode. You
have to reopen this bug. Sass packages involved are:

├─┬ gulp-sass@2.1.0
│ ├─┬ node-sass@3.4.1


Reply to this email directly or view it on GitHub
#47 (comment)
.

@bittner
Copy link
Author

bittner commented Nov 6, 2015

Here is the SassMeister gist: bittner/SassMeister-input.scss
Don't blame me for the syntax, I've noted the source of the code in the header comments.

@xzyfer
Copy link
Contributor

xzyfer commented Nov 13, 2015

This is a bug in recent versions, but the feature exists.

@xzyfer
Copy link
Contributor

xzyfer commented Nov 13, 2015

LibSass bug sass/libsass#1733

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