Is there a way to set a common image path for LESS files?

前端 未结 6 1365
面向向阳花
面向向阳花 2020-12-05 03:58

I am using the LESS styling language.

Consider the following CSS:

.side-bg
{
    background:url(../img/layout/side-bg.jpg) top no-repeat;    
}
         


        
6条回答
  •  孤城傲影
    2020-12-05 04:45

    Relative urls can be handled by the command line compiler, supposedly. There's probably some similar option you can set in the file watcher.

    https://github.com/cloudhead/less.js/wiki/Command-Line-Usage

    EDIT: There totally is. Just look: http://lesscss.org/usage/#command-line-usage-options

    relativeUrls: true
    

提交回复
热议问题