I am using Gulp CSSO to tidy up my CSS in WordPress but it deletes my comments, more specifically it deletes the theme meta data. Is there any way to get around this? Perhaps insert the theme meta data after I have run CSSO?
Leave a Reply
You must be logged in to post a comment.
The csso documentation page says that it will remove the comments,because they do not affect rendering, but:
So I don’t think you can preserve a comment with the wordpress metadata format.
Why don’t you apply gulp-csso first and then add the metadata as a prefix using gulp-header?
Actually, if you use the
!
at the beginning of a single comment declaration such as:WordPress will properly detect the declaration, and CSSO will preserve the comment.