Google Web Starter Kit
Get started building multi-device sites the Google way
Christopher Bloom, Phase2
cbloom@phase2technology.com
Why I care
- I collect development frameworks as a hobby. Apparently.
- Examining frameworks teaches us a little more about how to do it right
- I teach. New frameworks make my job easier
-
Shiny things are fun
Google's Web Fundamentals
- Multi-device tools*
- Multi-device layouts
- Forms and user input
- Images, audio, and video
- Optimizing performance
- Device access
Foundation? Ionic? Angular?
Not really.
"Web fundamentals" - and "Web starter kit" in particular - are a set of best practices, guides, and tools to make multi-device, responsive websites.
Web starter kit starts you off with a lot of annoying code prewritten.
Sound familiar?
Web starter kit is much much more
We're going to talk about
Tooling
Architecture
Getting started
Tools required
1. Git
git clone https://github.com/google/web-starter-kit.git
cd web-starter-kit/app
2. Node
3. Ruby
4. Sass
5. Gulp
sudo npm install --global gulp
cd web-starter-kit
npm install
Do not resist the modern web toolchain!
Gulp Goodies on `npm install`
- Imagemin
- Uglify
- Jshint
- Browser sync
- Many more
Pick a layout
/app/index.html = kitchen sink
/app/basic.html = stripped down
We'll use index.html. Delete basic.html.
Build
Notice no "dist" folder at root of the project:
Run "gulp" at the root of the project
comes with its own web server
Pagespeed Insights Reporter
gulp serve
(control+c)
gulp pagespeed
Serve results to external devices
Multi-device debugging!
So what about the Sass?
- Watching/compiling is integrated into the `gulp` and `gulp serve` commands
- The file structure is SMACSS-ish, markup/styles are BEM-ish
- THREE css files are included by default:
Then a bunch of custom styles to give us the default styles and responsiveness.
All default editable settings in _utils.scss
Sass continued
Modules vs Components, in Google terms:
Modules = specific, unique, custom site pieces (_page-header.scss)
Components = generic web structures (_link.scss)
General goodies
- Mobile-first
- Viewport meta
- Decent robots.txt
- Icons
- "Make this site an app on my phone": mobile-web-app-capable
- Footer js scripts
- Six column grid - very simple with predefined behavior
- Media queries: small, medium, wide, huge
Thanks!
Go try it:
https://developers.google.com/web/fundamentals