Unit tests for LESS/SCSS

Also fixes for #8894 and #8895.
Sorry for your time wasted on this issue. I've fixed it now.