Based on @GeekyMonkey's answer, I wrote this little shorthand, which you can put somewhere in your file less:
.debug(@var) {
&:after {
content: "@{var}";
font-size: 20px;
background-color: #fff;
border: 1px solid red;
padding: 10px;
border-radius: 5px;
color: red;
font-weight: bold;
position: absolute;
top: 50%;
left: 50%;
}
}
Then just use .debug(@someVar)and get its value printed on the screen. :-)
source
share