css - LESS Mixins not available -


in current project ive following structure in index icnludes:

...

<link rel="stylesheet/less" type="text/css" href="css/master.less" media="screen" />  <!--module source css--> <link rel="stylesheet/less" type="text/css" type="text/css" href="module/a/css/a.less" media="screen" /> <link rel="stylesheet/less" type="text/css" href="module/b/css/b.less" media="screen" /> 

...

in master.less include other less files mixin.less. in file have lot of declaration works fine - tested.

but if try use mixins .gradient in module b.less become error this: .gradient undefined

the gradient mixin placed in mixin.less totaly okay:

.gradient (@startcolor: white, @endcolor: #eee) {     background-color: @startcolor;     background: -webkit-gradient(linear, left top, left bottom, from(@startcolor), to(@endcolor));     background: -webkit-linear-gradient(top, @startcolor, @endcolor);     background: -moz-linear-gradient(top, @startcolor, @endcolor);     background: -ms-linear-gradient(top, @startcolor, @endcolor);     background: -o-linear-gradient(top, @startcolor, @endcolor); } 

when use mixin directly in b.less works. im confused about. im using client side part less.js , have read fkn manual on http://lesscss.org/ dont know whats wrong.

the files loaded correctly etc whats wrong here?

each of less files in html document gets compiled independently, mixins you're creating in master.less staying withing context of file only, , not visible other .less files.

i suggest this:

  1. create file mixins.less mixins,
  2. in master.less, import mixins.less file first, , import additional module less files,
  3. in html document, reference master.less only.

i agree situation you're experiencing isn't defined in documentation, assuming people want play less using less.js start 1 file.

hope helps.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -