Book Image

Mastering PostCSS for Web Design

By : Alex Libby
Book Image

Mastering PostCSS for Web Design

By: Alex Libby

Overview of this book

PostCSS is a tool that has quickly emerged as the future of existing preprocessors such as SASS and Less, mainly because of its power, speed, and ease of use. This comprehensive guide offers in-depth guidance on incorporating cutting-edge styles into your web page and at the same time maintaining the performance and maintainability of your code. The book will show how you can take advantage of PostCSS to simplify the entire process of stylesheet authoring. It covers various techniques to add dynamic and modern styling features to your web pages. As the book progresses, you will learn how to make CSS code more maintainable by taking advantage of the modular architecture of PostCSS. By the end of this book, you would have mastered the art of adding modern CSS effects to web pages by authoring high performing, maintainable stylesheets.
Table of Contents (21 chapters)
Mastering PostCSS for Web Design
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Adding reload capabilities


Adding a reload capability reduces the amount of time spent manually reloading our pages after a code change; the latter can be a real pain, especially when working with complex CSS styles!

The downside to this is that it only works in Chrome—if this isn't an issue, then these are the steps you would need to follow to make this work:

  1. We'll start by extracting copies of the gulpfile.js and package.json files from the T53 – adding livereload capabilities folder, from the code download that accompanies this book. Save both copies to the root of our project area.

  2. From the same T53 – adding livereload capabilities folder, extract and save a copy of the style.css file from the src folder within, to the src folder at the root of our project area.

  3. Fire up a Node.js command prompt, then change the working folder to our project area.

  4. In the prompt, enter npm install gulp-livereload –save-dev and press Enter—let this install.

  5. Download and install the Chrome applet for LiveReload...