开发者

How do I use variables in less with the Rails 3.1 Asset Pipeline

I am converting a number of less files into a r开发者_运维问答ails app, and running into problems with the processing of variables and other less features.

I require my assets in application.css, but when viewing the page see the following error:

Less::ParseError: variable @light-border is undefined
  (in tokens.css.less
Served asset /tokens.css - 500 Internal Server Error

I have a less file that defines all my variables and several other files that define various mixins.

The problem also seems to affect the mixins - looks like the less files are being processed individually, but not as a single context ... hence the variable and mixin errors. Individual files will render, but not include the various components and variables.

Is there a trick to getting this working in Rails?


I added the less-rails gem and it seems to work now. I think the asset pipeline doesn't actually support more than rudimentary less use.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜