18
Haml and Sass Your Guide to Beautiful and Sensible Markup

Haml Presentation

Embed Size (px)

Citation preview

Page 1: Haml Presentation

Haml and SassYour Guide to Beautiful and Sensible Markup

Page 2: Haml Presentation

Jason McCayA founding partner of CommonThread

[email protected]

Page 3: Haml Presentation

A bit of credit

• Created by Hampton Catlin

• Installed as RubyGem

• More advanced than you think behind the scenes

Page 4: Haml Presentation

The Point

• Remove the repetitive parts of HTML and CSS

• “Markup should be beautiful”

• ...and markup should be meaningful.

Page 5: Haml Presentation

The Key?

• Make white space mean something.

• Make every character mean something.

Page 6: Haml Presentation

Haml FirstLet’s create a Haml Haiku

Page 7: Haml Presentation

Example

• <h1 class=”title”>My Pictures</h1>

• %h1.title My Pictures

Page 8: Haml Presentation

Divs are Implied

• <div class=”container”>Text</div>

• .container

• Can you imagine the characters you could cut from your front-end code right now??!?!

Page 9: Haml Presentation

Heading to Textmate

Page 10: Haml Presentation

Interesting Features

• Filters (plain, HTML, redcloth, textile, javascript)

• Blocks are implied by indentation

• XHTML Helpers

Page 11: Haml Presentation

Okay, now to SassSimplify your CSS at no additional charge

Page 12: Haml Presentation

No real change to the attributes

Page 13: Haml Presentation

Beauty is in the nesting of the CSS rules

Page 14: Haml Presentation

Back to Textmate

Page 15: Haml Presentation

Final Notes on SassFeel the complexity leave your CSS

Page 16: Haml Presentation

Interesting Features

• Arithmetic

• Silent vs. Loud Comments

• Various Output Styles

Page 17: Haml Presentation

Thanks!

Page 18: Haml Presentation