简体   繁体   English

较少的CSS评论在正确的地方

[英]LESS CSS Comments in the right place

I am using LESS CSS for WordPress Theme development. 我正在使用LESS CSS进行WordPress主题开发。 I have just noticed that when I compile the LESS files to CSS all of the comments placed inside LESS file are added to the top of the CSS file (and not on the right line)... is there any way to avoid this? 我刚刚注意到,当我将LESS文件编译为CSS时,LESS文件中的所有注释都被添加到CSS文件的顶部(而不是在右边的行)...有什么办法可以避免这种情况吗? I am using Less for mac as a compiler also tried the simpLess but the same problem occurs. 我使用Less for mac作为编译器也尝试了simpLess,但同样的问题发生。

Whilst not ideal, and certainly against convention, I place my comments inside the style definition. 虽然不理想,当然也不符合惯例,但我将我的评论放在样式定义中。

eg: 例如:

.style {

    /* Comment for .style */
    ...style definition...

    .inner-style {
        /* Comment for .inner-style */
        ...style definition...
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM