Unit tests for LESS/SCSS

Also fixes for #8894 and #8895.
@ingorichter You fixed this in the other place, but you did not fix this case.