I'm setting up my gruntfile.js
for a new WordPress project in which I'll use LESS for managing CSS.
What I'm trying to accomplish here is to add the typical list of informations regarding the theme you can see at the top of every style.css
file in a WordPress theme. This is the code I'm using for the LESS task:
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'
}
}
}
With the code above I'm able to get this result:
/*!
Theme Name: nameofthewptheme
Theme URI: #
Author: Vincenzo Coppolecchia
Author URI: #
Description: Description for the theme goes here.
Version: 0.1.0
*/@font-face{...}...
The problem
As you can see, there are two (small) problems:
- right after the comment closing tag I have my CSS, so I guess the last line break isn't considered at all;
- at the beginning of the comment there's an exclamation mark (!).
Any help will be much appreciated.