Let’s push our final sample theme to your git hosting. Then let’s talk about the more advanced stuff you can do including additional PostCSS, cssnext, and more gulp tasks like SVG, image optimization, and scripts. You can look at what WebDevStudios is doing in their wd_s. You now have a completed Genesis starter theme. Yes, there are more things you can do with it, such as moving to a configuration architecture, more gulp tasks, and so on. But you can add those as you get working with your new theme. Congratulations! Start using your new codebase and it will save […]
A linter validates your Sass to coding standards. You will install the gulp node module: gulp-sass-lint. In this episode, you will install and code it into your gulp file. Then let’s run it to see what happens. Psst here is the link to the Sass Rem module.
Notifications send out a desktop message to alert you to errors and whatever message you want, such as “WooHoo your styles are done.” In this episode, you will install the following gulp packages: plumber and notify.
When you deliver your theme to your client for their live site, you will want to enqueue and use a minified stylesheet. Why? To speed up the web page’s loading, as the browser requests and downloads a smaller file. You will use a module called CSS Nano. There are a couple of different ones to use. In this episode, you will install and use the gulp-cssnano. Let’s walk through adding minification to our gulp tasks. You’ll also learn about the gulp sequencing order. And you will need the rename module too, to rename the minified file to style.min.css. Note: PostCSS […]
Did you notice the media queries are dispersed throughout your stylesheet? If you are using min-width (not max-width) media queries, then you can use the Media Query Packer node module.
Now that your styles are in Sass modules, when you are building, tweaking, and debugging your styles in the browser, it shows the stylesheet and not the respective Sass partial file. It becomes cumbersome to find where your styles are when you want to make a change. Sourcemap solves that problem for you. In the browser, it will show you the Sass partial file associated with the element instead of style.css. It will save you a lot of time and frustration as you are building. You are going to love this module. To install it locally into your theme, type […]
The first step is to make sure you have gulp installed globally. You need to have both node and npm installed. Then do the following: Open terminal. Type: npm install gulp –g When it’s done installing, type: gulp -v If you get a version number, you are ready to rock and roll. Next let’s create the package.json boilerplate file. To do that, let’s run the init out of npm which will walk you through the options: npm init Just keep pressing the return (enter) key on your keyboard to select the defaults. When done, then open up the file. Now […]
It’s time to do more with gulp. While gulp is awesome at processing Sass, you can do more tasks such as sourcemaps, minifying, error handling, notifications, linting (error checking), and even more time-saving shortcut modules within Sass itself. Let’s finish up your gulp setup file and get you cranking out CSS in less time. Let’s do more.