A relatively new client of ours is running a sage-based site. When we went in to make some CSS changes, we went to the source CSS file and tried to minifiy it back to main.min.css but we ran into some hiccups.
Is there a “best practice” for brining over a Sage site? Do we need to run the Gruntfile.js to compile CSS changes and not do it manually?
Or should we start with this: https://roots.io/sage/docs/theme-installation/ and go from there?
Thank you in advance!
Hi David. The current documentation on the website is for the latest version of Sage and from the sounds of it you’ve got an older version of Sage on your hands. It will be helpful to first identify what version of Sage it is using. I could very well be wrong here as I’ve only used Sage from version 8 and later, but if a
Gruntfile is present, it sounds like it should prior to 8 (when it was known as the Roots Starter Theme). If your go through the tagged versions on the Sage repo you may find some help. It’s most likely a good idea to stick with the build process that the theme was built with.
Thank you! It’s 6.5.
It looks like I need to install node and grunt.
Do you know if there’s a way to manually run the LESS updates?
Where there’s a will, there’s a way.
You could use the Less compiler to build the styles. Just install it and run
lessc path/to/source.less path/to/output.min.css. Looks like it would be missing the versioning step though — so it’s probably not a good idea unless you removed the versioning from the enqueued styles or a figured out an alternate solution.
It still would be best to stick to the Grunt build process, since it was designed for the version of the theme you’ve got. Let us know if you are having difficulty with that before trying any alternate solutions.