create your own starter files

57
Some rights reserved Create Your Own Starter Files Emily Lewis for CSS Dev Conf OCT 13, 2014 #starterfiles

Upload: emily-lewis

Post on 14-Jun-2015

410 views

Category:

Technology


2 download

DESCRIPTION

Presentation for CSS Dev Conf 2014 Have a love/hate relationship with pre-built frameworks? Consider building your own system for front-end development.

TRANSCRIPT

Page 1: Create Your Own Starter Files

Some rights reserved

Create Your Own

Starter Files Emily Lewis for CSS Dev Conf

OCT 13, 2014

#starterfiles

Page 2: Create Your Own Starter Files

Some rights reserved

Create Your Own

Starter Files Emily Lewis for CSS Dev Conf

OCT 13, 2014

#starterfiles

Page 3: Create Your Own Starter Files

Owner, Lead Developer abrightumbrella.com

Author, Microformats Made Simplemicroformatsmadesimple.com

Co-author, HTML5 Cookbookshop.oreilly.com/product/0636920016038.do

Managing Editor, Web Standards Sherpawebstandardssherpa.com

Co-host, CTRL+CLICK CASTctrlclickcast.com

Page 4: Create Your Own Starter Files

I’m a code freak

Page 5: Create Your Own Starter Files

Frameworks♡

Page 6: Create Your Own Starter Files

the Idea of• Getting a site up and and running quickly and

easily

• Building sites consistently with responsive techniques

• Rapid prototyping to define scope and inform project deliverables

Page 7: Create Your Own Starter Files

in Practice• More than what I need for the types of projects I

build

• Difficult for me to “adapt” to someone else’s approach

• What works for prototyping rarely works for my production code

Page 8: Create Your Own Starter Files

in Practice• I’m removed from the fundamental

understanding of why a given technique is used

• Can be harder to troubleshoot

• Can lead to bloated code

themetaq.com/articles/the-pros-and-cons-of-using-a-front-end-framework★

Page 9: Create Your Own Starter Files

My Old Process

1. Choose the most recent completed project that shares common elements

2. Copy

3. Paste

4. Tweak

5. Repeat

Page 10: Create Your Own Starter Files

My Old Deliverables

• Static wireframes

• Visual comps

• Front-end templates

• CMS integration

Page 11: Create Your Own Starter Files

18 Months Ago ...

• Hired Lea Alcantara as a designer

• Lea’s workflow includes earlier decisions about visual presentation than comps

• New deliverable: Element Collage

danielmall.com/articles/rif-element-collages/★styletil.es/★

Page 12: Create Your Own Starter Files

18 Months Ago ...

• More responsive work, more responsive deliverables

• New deliverable: Live Wires

www.ngenworks.com/blog/live-wires-better-prototyping/★

Page 13: Create Your Own Starter Files

18 Months Ago ...

• Clients needed different resources than they had in the past

• New deliverable: Style Guide

Page 14: Create Your Own Starter Files

Today’s Deliverables

• Element Collages

• Live Wires

• Front-end templates

• CMS integration

• Web-based Style Guide

Page 15: Create Your Own Starter Files

Me, the Business wner

Productivity&

Profit

Page 16: Create Your Own Starter Files

Me, the Devel per

Code FreakConniptions

Page 17: Create Your Own Starter Files

Managed Solution• Relies on our preferred coding and naming

conventions

• Includes what we need, but not what we don’t

• Relies on techniques that I understand, can explain and can troubleshoot

• Defines and documents internal standards

Page 18: Create Your Own Starter Files

Managed Solution• Scales for bespoke projects that have all our

deliverables

• Scales for new projects that need a new type of deliverable

• Scales for projects that only need one deliverable

Page 19: Create Your Own Starter Files

Managed Solution• Limits repetition (DRY)

• Ties all web-based deliverables together, so that prototyping code easily evolves to production code

• Faster project setups

• Faster client deliverables

• Lets us focus our energy on custom work

Page 20: Create Your Own Starter Files

Enter: “Starter Files”

• Began as just the core Sass assets and organization that I created for basic template styling

• Evolved into a system of shared front-end assets that can be used by all of our web-based deliverables

ctrlclickcast.com/episodes/cms-markup-templating★

Page 21: Create Your Own Starter Files

Starter Files Mindset

Page 22: Create Your Own Starter Files

The Mindset

• Stop thinking of assets and instead think of a system

• Doesn’t need to be a fully realized approach before you can use it

• Constantly evolving

Page 23: Create Your Own Starter Files

The Rules• Don’t go back and update completed projects when Starter

Files are updated unless there is budget and time

• Try new techniques when a project specifically calls for it, so that the client is paying for the “new” development

• After every project is complete, revisit Starter Files and incorporate anything new that was learned during the project

• If new ideas occur during a project, but aren’t relevant to that project, make note and set aside to address in the future

Page 24: Create Your Own Starter Files

The Prep• How do you work now and how do you want to work in the future?

• What parts of your business/deliverables do you want to support?

• What are your naming conventions?

• How do you want to organize directories and subdirectories?

• What do your team members need and what are they open to?

• What are your patterns in HTML and CSS, even JS?

• What can be shared and what is unique to each type of deliverable?

Page 25: Create Your Own Starter Files

Our Starter System

Organization & Structure Naming

• Organized by project deliverables

• Needed to identify what assets were:

• Global

• Shared

• Deliverable-specific

Page 26: Create Your Own Starter Files

Organization

Sass Partials - Global & Shared

Page 27: Create Your Own Starter Files

Organization

Sass Partials - Element Collage

Page 28: Create Your Own Starter Files

Organization

Sass Partials - Live Wires

Page 29: Create Your Own Starter Files

Organization

Sass Partials - Templates

Page 30: Create Your Own Starter Files

Organization

Sass Partials - Style Guide

Page 31: Create Your Own Starter Files

Organization

HTML Assets - Global

Page 32: Create Your Own Starter Files

Organization

HTML Assets - Deliverables

Page 33: Create Your Own Starter Files

Our Starter System

Modularity

• Look for repeated patterns across deliverables and abstract the parts that are common among them

• Minimize repetition in both HTML and CSS

webstandardssherpa.com/reviews/think-modularly/★

Page 34: Create Your Own Starter Files

Modularity

Sass Placeholders

Page 35: Create Your Own Starter Files

Modularity

Global HTML Modules

Page 36: Create Your Own Starter Files

Our Starter System

Naming Conventions

• Single class pattern vs. multiple class pattern

• Moving away from strictly content-based semantics

• Class name = HTML module file name

nicolasgallagher.com/about-html-semantics-front-end-architecture/★bem.info★

Page 37: Create Your Own Starter Files

Our Starter System

Naming Conventions

• Base rules, element selectors

• Layout rules, prefixed classes

• Module rules, block-element classes

smacss.com/★

Page 38: Create Your Own Starter Files

Naming Conventions

Module Rules

Page 39: Create Your Own Starter Files

Our Starter System

Building Deliverables

• Basic PHP includes

• Global includes

• Global modules

• Deliverable-specific includes and modules

Page 40: Create Your Own Starter Files

Building Deliverables

Creating a Document “Shell”

Page 41: Create Your Own Starter Files

Building Deliverables

Creating Element Collages

Page 43: Create Your Own Starter Files

Building Deliverables

Evolving the Process

• Style Guide from Sass comments

• Some combination of (or inspiration from) all

warpspire.com/posts/kss/★github.com/jacobrask/styledocco/★

Page 44: Create Your Own Starter Files

Our Starter System

Maintenance

• “Living” documentation on Google Docs

• System is version controlled with Git

www.git-tower.com/★beanstalkapp.com/★

Page 46: Create Your Own Starter Files

Integrated SystemLive Wires+Element Collage

Page 47: Create Your Own Starter Files

Integrated System = Front-end templates

Page 48: Create Your Own Starter Files

Integrated System= Style Guide

Page 49: Create Your Own Starter Files

Serious Investment

• It isn’t easy

• It takes time (= money)

• It takes focus

• It takes a commitment to maintaining/evolving

Page 50: Create Your Own Starter Files

Me, the Business wner

• Faster setup of new projects, regardless of scale

• Deliverables build on each other, prototyping to production

• Internal standards for team, consistency

• More DRY

Page 51: Create Your Own Starter Files

• I get to fly my code freak flag

• The onus is on me to stay up-to-date; constant state of learning

• I’m confident in the techniques I’m using; can troubleshoot and explain

Me, the Devel per

Page 52: Create Your Own Starter Files

• Invest in your business/company to find efficiencies and deliver better products

• Use what you want, need and are comfortable with - this can include frameworks!

• Invest in yourself to stay educated

Create Your Own

Page 53: Create Your Own Starter Files

★ Resources• The pros & cons of using a front-end framework

themetaq.com/articles/the-pros-and-cons-of-using-a-front-end-framework

• Reading Is Fundamental Element Collagesdanielmall.com/articles/rif-element-collages/

• Style Tilesstyletil.es/

• Live Wireswww.ngenworks.com/blog/live-wires-better-prototyping/

• CMS Markup & Templating with Allison Wagnerctrlclickcast.com/episodes/cms-markup-templating

Page 54: Create Your Own Starter Files

★ Resources• Think Modularly

webstandardssherpa.com/reviews/think-modularly/

• About HTML semantics and front-end architecturenicolasgallagher.com/about-html-semantics-front-end-architecture/

• BEMbem.info

• SMACSSsmacss.com/

• Creating HTML Templates with Mustache.jswww.sitepoint.com/creating-html-templates-with-mustachejs/

Page 55: Create Your Own Starter Files

★ Resources• Creating Recursive HTML Templates in Mustache.js Using Partials

letscodetheweb.com/creating-recursive-html-templates-in-mustache-js-using-partials/

• Emmet: Write Even Less, Do Even Morethemetaq.com/articles/emmet-write-even-less-do-even-more

• Knyle Style Sheetswarpspire.com/posts/kss/

• StyleDoccogithub.com/jacobrask/styledocco/

• Towerwww.git-tower.com/

Page 56: Create Your Own Starter Files

★ Resources• Beanstalk

beanstalkapp.com/

• Git Submodules Workflow Tipsblogs.atlassian.com/2013/03/git-submodules-workflows-tips/

• Alternatives to Git Submodulesblogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/