-
Notifications
You must be signed in to change notification settings - Fork 198
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
compact() removed from libsass 3.0.1 #34
Comments
I hot fixed this issue by adding this function:
taken from http://stackoverflow.com/a/11752227 |
I have to correct my earlier statement. It did not solve all problems, While I was no longer getting errors, I noticed that the css output was no longer valid. With the above function I was getting things like:
I have written my own compact function now, which seems to solve the problem (though its pretty late, so I might be missing something).
PS: please note that there also has been bug (sass/libsass#254) reported recently about false-ish values that are not evaluated as false which might effect the outcome of this function. that might cause issues with this code, but does not seem to be the case/has been fixed in latest master. |
Both of those were giving me issues by not putting commas between multiple box-shadow properties. This works for me:
|
I had this issue as well. |
I saw that in the release notes, and thought of this as well. I think the functions above may make sense to include to resolve the problems. Is there a PR? |
@michaek I never made one. |
I'm adding @mikob's function to the new release. |
@Igosuki +1 That's great news! I've been relying on a separate _compact.scss and it'd be great to finally dump that li'l old thing. 😃 |
Done in v0.12.7 |
I had an issue with recursive compact arguments. It was leaving false items in. I combined the above solutions and this fixed it:
|
So this is a bug with the current version (0.12.7) ? |
Yes, it is a bug in 0.12.7. mikob's implementation used in 0.12.7 leaves extraneous falses to the output like: EDIT: This works for me: @function compact($vars...) {
$first: nth($vars, 1);
$sep: comma;
$list: ();
@if length($vars) == 1 and type_of($first) == 'list' {
$vars: $first;
$sep: list-separator($vars);
}
@each $var in $vars {
@if $var {
$list: append($list, $var, $sep);
}
}
@return $list;
} I got inspiration from the original ruby implemenation: https://github.com/Compass/compass/blob/master/core/lib/compass/core/sass_extensions/functions/lists.rb#L17 |
Closely implementing the ruby function is how it should be done in the first place, thanks. |
Wish I came across this sooner..have spent the past hour or so pulling my hair over the fact that my simple |
I'm still getting incorrect output with version 0.12.7. For example the Sass: Yields:
I get the same output when I replace |
Same here. I'm using 0.12.7.
output:
|
This version (#67) works for both single & multiple transitions:
|
Had the same problem with @include background(#ccc); Above solution of leochen1216 works. |
Can confirm that leochen1216 also fixed my issue with @include background(#ccc). Excuse my ignorance but why was this function deprecated in a minor release? |
leochen1216 function's works perfectly for me, thank you ! issue with @include single-transition(border, .2s, ease-in); |
@each $arg in $args won't work here when the first argument is list. It only returns first value in the first argument (list). eg: ((opacity .2s ease), false, false, false) The $arg will be opacity if we use @each, and this caused all the problems people mentioned in this issue: Igosuki#34 Tested with single transition and multiple transitions, all work fine. // single transition @include transition(opacity .2s ease); // multiple transitions @include transition(transform .2s ease-out, top .3s ease-out);
More info: Igosuki/compass-mixins#34 Signed-off-by: Samuel Guimarães <sguimaraes943@gmail.com>
Fixed in v0.12.8 |
How is this fixed, exactly? Shouldn't the reimplementation of compact() be in "shared" or some other file that all scripts source? |
I am also troubled by the lack of the compact() function... functions/_lists.scss says on line 7,
but when googling for that it seems it has somehow removed from libsass? Thanks! |
More info: Igosuki/compass-mixins#34 Signed-off-by: Samuel Guimarães <sguimaraes943@gmail.com>
A recent change in libsass broke compass compatibility by removing the compact() function... The function was removed because it's not in the sass spec.
sass/libsass@003d3dc
The text was updated successfully, but these errors were encountered: