我正在为一个新的 WordPress 项目设置我gruntfile.js
的项目,在该项目中我将使用 LESS 来管理 CSS。
我在这里要完成的是添加有关主题的典型信息列表,您可以在style.css
WordPress 主题中的每个文件的顶部看到。这是我用于 LESS 任务的代码:
less: {
development: {
options: {
compress: true,
banner: '/*!\n' +
'Theme Name: <%= pkg.name %>\n' +
'Theme URI: <%= pkg.url %>\n' +
'Author: <%= pkg.author.name %>\n' +
'Author URI: <%= pkg.author.website %>\n' +
'Description: <%= pkg.description %>\n' +
'Version: <%= pkg.version %>\n' +
'*/' +
'\n'
},
files: {
'css/myfile-build.min.css': 'less/myfile.less'
}
}
}
使用上面的代码,我可以得到这个结果:
/*!
Theme Name: nameofthewptheme
Theme URI: #
Author: Vincenzo Coppolecchia
Author URI: #
Description: Description for the theme goes here.
Version: 0.1.0
*/@font-face{...}...
问题
如您所见,有两个(小)问题:
- 在评论结束标记之后我有我的 CSS,所以我想最后一个换行符根本不被考虑;
- 在评论的开头有一个感叹号(!)。
任何帮助都感激不尽。