I'm doing some debugging of a very complex parent / child theme system with Bootstrap and LESS CSS. I won't get into the details of that issue, except to say that I'm declaring custom colors and other variables in variables.less
but the compiled CSS is not using these variables, however, I've verified that the file is actually being compiled and successfully included.
So, what I really need is to be able to somehow console.log
the LESS variables (specifically at compile runtime), but despite the fact that LESS claims to support javascript inside of LESS files, that wasn't working. Can anyone shed light on this / have experience with it?
It often happens that console. log are forgotten in several places in the code, which besides a hypothetical loss of performance (tiny, but whose size varies according to the data called through the log method), is not very clean. The solution is to use the debugging tools provided by your browser.
Using console. log will use CPU cycles. In computing, nothing is "free." The more you log, the slower your code will execute.
If you want to do this to an object that has been already logged (one time thing), chrome console offers a good solution. Hover over the printed object in the console, right click, then click on "Store as Global Variable". Chrome will assign it to a temporary var name for you which you can use in the console.
but despite the fact that LESS claims to support javascript inside of LESS files, that wasn't working.
It is:
@var: value;
.test {
width: ~`console.log("@{var}"), "@{var}"`;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With