How to debug less css variables

css, less

Solution

Based on @GeekyMonkey's answer, I wrote this little snipped you can put somewhere in your less file:

.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 to the screen. :-)

Problem

As the title stated, how would I debug less css variables. For an example. ``` //style.less @height: `document.body.clientHeight`; ```

Original source