Book Image

Getting Started with Polymer

By : Arshak Khachatrian
Book Image

Getting Started with Polymer

By: Arshak Khachatrian

Overview of this book

<p>Polymer is a library that helps you develop fast, responsive applications for the desktop and mobile web. It uses the Web Components specifications for the components and Material Design concepts to create a beautiful user interface.</p> <p>This focused, fast-paced guide deals with Polymer web components. We will cover layouts, attributes, elements, and handling touch and gesture events. You will also see how to build custom web components and applications using Polymer. Don’t want to code? You can make the most of the Polymer Designer Tool app and create your own app without coding at all. Finally, you will see how you can improve your Polymer application by reading the best practices from Google Polymer team.</p> <p>By the end of this book, you will be equipped with all the necessary skills to use Polymer to create custom web components.</p>
Table of Contents (16 chapters)
Getting Started with Polymer
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Preface
Index

Setups


First of all, we need to set up the Gulp, so follow the steps listed next:

  1. Install npm:

    $ npm init 
    
  2. Install Bower:

    $ npm install bower –g 
    
  3. Install Gulp:

    $ npm install gulp
    

    This last command will install Gulp locally to the project.

    Now, we need to install the Gulp plugins to achieve the tasks locally.

  4. Install all necessary Gulp plugins:

    $ npm install gulp-ruby-sass gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-notify gulp-cache gulp-rename del --save-dev
    
  5. Create gulpfile.js, and load the plugins:

    var gulp = require('gulp'),
        sass = require('gulp-ruby-sass'),
        cssnano = require('gulp-cssnano'),
        jshint = require('gulp-jshint'),
        uglify = require('gulp-uglify'),
        concat = require('gulp-concat'),
        notify = require('gulp-notify'),
        rename = require('gulp-rename'),
        cache = require('gulp-cache'),
        del = require('del');
  6. Create Gulp tasks for SASS and JS:

    gulp.task('styles', function() {
      return sass('assets/scss/main.scss', { style: 'expanded' })
        .pipe(gulp...