CSS Meetup at The Hive in Rock Hill, SC - 2014

27
{CSS} A Random Talk about Carolina Style Sheets by John Rouda

description

CSS Meetup - June 16, 2014 at The Hive in Rock Hill, SC. Discussing CSS Levels, Cleaning up dirty code, preprocessors, and 5 mistakes to avoid.

Transcript of CSS Meetup at The Hive in Rock Hill, SC - 2014

Page 1: CSS Meetup at The Hive in Rock Hill, SC - 2014

{CSS}A Random Talk about Carolina Style

Sheetsby John Rouda

Page 2: CSS Meetup at The Hive in Rock Hill, SC - 2014

John RoudaProfessional Jack of All Trades

Page 3: CSS Meetup at The Hive in Rock Hill, SC - 2014

Elegance of CSS

Page 4: CSS Meetup at The Hive in Rock Hill, SC - 2014

What to talk about?

CSS 1, 2, 3….4? Understanding CSS Levels

Cleaning up Your Dirty CSS

CSS Preprocessors (Less, Sass, Stylus)

Mistakes to Avoid in CSS

Page 5: CSS Meetup at The Hive in Rock Hill, SC - 2014

CSS 1, 2, 3, 4? Understanding CSS Levels (versions, etc.)

Page 6: CSS Meetup at The Hive in Rock Hill, SC - 2014

CSS 1W3C Specs

CSSWG

1996 – Font Properties, alignment, etc.

Page 7: CSS Meetup at The Hive in Rock Hill, SC - 2014

CSS 2Published in 1998

Superset of CSS1

Absolute, relative, fixed, etc.

Then, we found it was all wrong, and made CSS 2.1

Page 8: CSS Meetup at The Hive in Rock Hill, SC - 2014

CSS 3Not a version of CSS (unlike 1, 2, 2.1)

Factored into Modules and modules are leveled.

Earliest drafts were in 1999.

By June 2012 over 50 CSS3 Modules were published:

Media Queries, Namespaces, Selectors, etc.

Page 9: CSS Meetup at The Hive in Rock Hill, SC - 2014

CSS4

Page 10: CSS Meetup at The Hive in Rock Hill, SC - 2014

CSSWG ProcessBrainstorming

Working Draft (WD)

Last Call (LCWD)

Candidate Recommendation (CR)

Proposed Recommendation (PR)

Recommendation (REC)

Page 11: CSS Meetup at The Hive in Rock Hill, SC - 2014

Cleaning up Your Dirty CSS

We’ve all got it… let’s just clean it up.

Page 12: CSS Meetup at The Hive in Rock Hill, SC - 2014

3 Ways to keep it clean

1. Group Reusable Properties together2. Use naming Conventions3. Keep Your Tabs Straight

Page 13: CSS Meetup at The Hive in Rock Hill, SC - 2014

Group Reusable Properties

Reduce, Reuse, Recycle

SMACSS & OOCSS

Page 14: CSS Meetup at The Hive in Rock Hill, SC - 2014

Naming Connection

.

Page 15: CSS Meetup at The Hive in Rock Hill, SC - 2014

Keeping Your Tabs Straight

Page 16: CSS Meetup at The Hive in Rock Hill, SC - 2014

CSS PreProcessorsLess, Sass, Stylus and why use them at

all?

Page 17: CSS Meetup at The Hive in Rock Hill, SC - 2014

PreprocessorsLess

For those that fear command line

Download less.app

SassFor the Ruby folks

sudo gem install sass

sudo gem install compass

StylusFor the node.js folks

sudo npm install stylus -g

Page 18: CSS Meetup at The Hive in Rock Hill, SC - 2014

Reasons to Use a Preprocessor

It’s Fun!

There are frameworks built on them, such as Compass built on Sass.

Easy to install – gem install sass, or less.app

Organizes your CSS

Makes your code easier to maintain

Makes your CSS DRY

Saves Time

Gives you what CSS should have to begin with:Calculations, Functions, Variables, Nesting, Mixins, etc.

Page 19: CSS Meetup at The Hive in Rock Hill, SC - 2014

Cool Things with PreProcessors

Page 20: CSS Meetup at The Hive in Rock Hill, SC - 2014

Mistakes To Avoid5 Mistakes to Avoid

Page 21: CSS Meetup at The Hive in Rock Hill, SC - 2014

1) Forgetting Comments Always comment your code… the more

detail the better.

Page 22: CSS Meetup at The Hive in Rock Hill, SC - 2014
Page 23: CSS Meetup at The Hive in Rock Hill, SC - 2014

2) Using Inline StylesThey are a lazy coder’s way of doing

things.

Page 24: CSS Meetup at The Hive in Rock Hill, SC - 2014

3) Forgetting DRY Techniques

Don’t Repeat Yourself – Avoid repeating code…

WET = We Enjoy Typing

Page 25: CSS Meetup at The Hive in Rock Hill, SC - 2014

4) Not Using Shorthand

Page 26: CSS Meetup at The Hive in Rock Hill, SC - 2014

5) Calling it Carolina Style Sheets

Cascading Style Sheets

Page 27: CSS Meetup at The Hive in Rock Hill, SC - 2014

Thank You@johnrouda

Follow me on Twitter@johnrouda

http://www.johnrouda.com

Checkout my book

http://www.whatshtml.com/