themes that perform short: wordcamp antwerp 2016

33
Themes that perform: Creating Faster themes for non developers

Upload: octavio-andres-cifuentes

Post on 15-Apr-2017

423 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Themes that perform short: WordCamp Antwerp 2016

Themes that perform:

Creating Faster themes for non developers

Page 2: Themes that perform short: WordCamp Antwerp 2016

Andrés CifuentesWPML Supporter | WPML Training

Page 3: Themes that perform short: WordCamp Antwerp 2016

Agenda

Performance budget.

Underscores and Components.

Installing grunt.js

Responsive images

¿Questions?

Page 4: Themes that perform short: WordCamp Antwerp 2016

Budget¿How can we measure it?

Time vs Data

Page 5: Themes that perform short: WordCamp Antwerp 2016

WebPageTest

Google PageSpeed

Pingdomhttps://css-tricks.com/performance-tools/

Budget

Page 6: Themes that perform short: WordCamp Antwerp 2016

WebPageTest: Speed index (1000?)

Budget

Page 7: Themes that perform short: WordCamp Antwerp 2016

Budget

Google pageSpeed 90/100 (?)

Page 8: Themes that perform short: WordCamp Antwerp 2016

Budget

Pingdom: Performance grade (?)

Page 9: Themes that perform short: WordCamp Antwerp 2016

Structure

¿Where can I start?

Page 10: Themes that perform short: WordCamp Antwerp 2016

Structure

UnderscoresComponents

Page 11: Themes that perform short: WordCamp Antwerp 2016

StructureSemantically correct

WordPress guidelines

Automattic

Minimum necessary

Page 12: Themes that perform short: WordCamp Antwerp 2016

Installing Grunt.js

¿Why?

Page 13: Themes that perform short: WordCamp Antwerp 2016

Repetitive tasks automatisation.

Work with small fragments for CSS and JavaScript.

Compress and minify CSS and JavaScript.

Reduce http calls.

Images optimisation.

Sass

Installing Grunt.js

Page 14: Themes that perform short: WordCamp Antwerp 2016

Installing Grunt.js

¿Why not?

Page 15: Themes that perform short: WordCamp Antwerp 2016

I don’t need it.

It runs on node.js

I’m just a designer.

Installing Grunt.js

Page 16: Themes that perform short: WordCamp Antwerp 2016

Installing Grunt.js

Requirements

Page 17: Themes that perform short: WordCamp Antwerp 2016

Installing Grunt.js

Pre-install node.js

Page 18: Themes that perform short: WordCamp Antwerp 2016

Installing Grunt.js

npm install -g grunt-cliGrunt CLI (command line interface)

Page 19: Themes that perform short: WordCamp Antwerp 2016

Installing Grunt.jsYou need the following two

files in your theme root.

package.json

Gruntfile.js

Page 20: Themes that perform short: WordCamp Antwerp 2016

Installing Grunt.js

This file allows you to install

the node.js dependencies.

Let’s call it our Grunt.js

archive file

package.json

Page 21: Themes that perform short: WordCamp Antwerp 2016

Installing Grunt.js

npm install

Page 22: Themes that perform short: WordCamp Antwerp 2016

Installing Grunt.js

Let’s configure

Grunt.js

grunt.js

Page 23: Themes that perform short: WordCamp Antwerp 2016

Installing Grunt.js1. Source > Destination

Archives SCSS => CSS

2. Autoprefixer

3. Minimize

grunt-autoprefixer

grunt-contrib-cssmin

grunt-sass

Page 24: Themes that perform short: WordCamp Antwerp 2016

Installing Grunt.js

Concatenate our

JavaScript files.

Uglify(?) them.

grunt-contrib-uglify

grunt-contrib-concat

Page 25: Themes that perform short: WordCamp Antwerp 2016

● Optimise all our

png / jpg / gif images.

Installing Grunt.js

grunt-contrib-imagemin

Page 26: Themes that perform short: WordCamp Antwerp 2016

Installing Grunt.js● All these tasks are

executed

automatically

grunt-contrib-watch

Page 27: Themes that perform short: WordCamp Antwerp 2016

grunt watch

Installing Grunt.js

Page 28: Themes that perform short: WordCamp Antwerp 2016

¿What have we done with all this?

Installing Grunt.js

Page 29: Themes that perform short: WordCamp Antwerp 2016

Repetitive tasks automatisation.

Work with small fragments for CSS and JavaScript.

Compress and minify CSS and JavaScript.

Reduce http calls.

Images optimisation.

Sass

Installing Grunt.js

Page 30: Themes that perform short: WordCamp Antwerp 2016

ExperimentFirst day:

Page 31: Themes that perform short: WordCamp Antwerp 2016

ExperimentFourth day:

Page 32: Themes that perform short: WordCamp Antwerp 2016

Agenda

Performance budget.

Underscores and Components.

Installing grunt.js

Responsive images

¿Questions?

Agenda

Page 33: Themes that perform short: WordCamp Antwerp 2016

@andescifuentesr

[email protected]

¿Questions?