Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to print SASS value to output?

Tags:

css

sass

Suppose we have:-

$value: 13.37; $length: $value + 0em;

Now i wanted to check the value of $length. Is there anything similar to Javascript's Console.log?

like image 599
JA9 Avatar asked Jul 12 '16 19:07

JA9


1 Answers

If you want it to appear on the page itself, I believe you could attach it as the value of a pseudo-element. Something like:

body::before{ content: "#{$length}"}

Additionally, sass includes @error, @warn, @debug directives that will log things to the terminal to verying degrees of of noisiness.

@error "the value of $length is `#{$length}`" 

More info on those can be found here

like image 168
Brice Avatar answered Nov 05 '22 12:11

Brice