【问题标题】:how can I compile less files我怎样才能编译更少的文件
【发布时间】:2014-06-02 07:41:40
【问题描述】:

我是新手。听起来很吸引人!

目标:

  • 将少一个文件编译成多个 css 文件(对于基于主题的 css):

设置:

main.less 导入 variables.less(变量包含不同的颜色模式)

Folder structure
\main.less
\variables.less
\theme\christmass\variables.less
\theme\newyear\variables.less

我想为每个变量调用lesscss.less(包含不同的颜色)

lesscss main.less main.css
lesscss main.less main{theme}.css path={theme_christmaspad}/variables.less
lesscss main.less main{theme}.css path={theme_newyearpad}/variables.less

问题:

我似乎无法设置 Visual Studio 的预构建事件来编译 css!我怎样才能使这项工作?

这是错误信息:

Error   1   The command "lessc" exited with code 9009

【问题讨论】:

  • 使用 Web Essentials 之类的插件可能会有更好的运气:vswebessentials.com/features/less
  • 我现在用这个。但是没有为每个文件提供编译选项。也没有办法导入具有动态路径的文件。我使用了另一种解决方案来解决我的问题。我会发布它

标签: visual-studio-2012 less


【解决方案1】:

我使用了不同的方法,我确实使用了 Web Essentials

对于每个主题,我在其中创建了一个文件themex.less

  1. 导入主变量(由于 webessentials 错误,这不在主文件中)
  2. 导入主文件
  3. 导入覆盖主要变量的主题变量

就是这样,非常简单明了。

【讨论】:

    猜你喜欢
    • 2020-09-16
    • 1970-01-01
    • 2019-12-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多