Skip to content

Instantly share code, notes, and snippets.

@piouPiouM
Created October 17, 2013 18:50
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piouPiouM/7030210 to your computer and use it in GitHub Desktop.
Save piouPiouM/7030210 to your computer and use it in GitHub Desktop.
My version of @hugogiraudel‘s http://codepen.io/HugoGiraudel/pen/unyBH with a shell output.
$ sass -t expanded test01.scss
test01.scss:10 DEBUG: list of 3 values:
test01.scss:14 DEBUG: - (string) a
test01.scss:14 DEBUG: - (color) #bada55
test01.scss:14 DEBUG: - (number) 42
test01.scss:10 DEBUG: list of 2 values:
test01.scss:14 DEBUG: - (bool) false
test01.scss:14 DEBUG: - (string) yummy
test01.scss:14 DEBUG: (number) 14px
test01.scss:14 DEBUG: (string) gloubiboulga
// @private
@function ppm_debug($prefix, $vars...) {
$result: '';
@each $item in $vars {
$type: type-of($item);
@if 'list' == $type {
@debug 'list of #{length($item)} values:';
$result: ppm_debug(' - ', $item...);
}
@else {
@debug '#{$prefix}(#{$type}) #{$item}';
}
}
@return "";
}
// Display clean debug
@mixin ppm_debug($vars...) {
$result: ppm_debug('', $vars...);
}
.page {
@include ppm_debug(a #BADA55 42, false yummy, 14px, "gloubiboulga");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment