我想让我的手写笔文件接受来自grunt的变量输入,循环变量值,并输出不同主题的css文件。
然后我可以很容易地像这样切换主题。https://stackoverflow.com/a/7847009/55124
这个是可能的吗?如何设置它呢?
现在我已经把手写笔编译成我的css了。但是,要生成一个不同的主题,我必须手动更改mainCSS.stylus文件中的themeName变量的值,并使用grunt进行重新构建。
发布于 2014-01-18 00:38:26
你对这种方式有什么看法:
有一个main.styl,它包含:
@import "variables"; 
//some other styles and imports还有一些主题文件:
 themes/default.styl
 themes/pretty-theme.styl
 themes/very-pretty-theme.styl使用grunt-contrib copy,您可以将文件themes/default.styl复制到variables.styl并将输入笔编译为css样式,然后删除variables.styl并再次将themes/pretty-theme.styl复制到variables.styl并进行编译,依此类推。
copy: {
  default-theme: {
    src: 'themes/default.styl',
    dest: 'variables.styl',
  },
  pretty-theme: {
    src: 'themes/pretty-theme.styl',
    dest: 'variables.styl',
  },
  very-theme: {
    src: 'themes/very-pretty-theme',
    dest: 'variables.styl',
  },
}https://stackoverflow.com/questions/21169016
复制相似问题