SlideShare une entreprise Scribd logo
1  sur  16
Télécharger pour lire hors ligne
Haml and Sass
 Put your markup on a diet




                             1
(X)HTML is unwieldy
  •   Repetition

      •   Closing tags

      •   id and class everywhere

  •   Arbitrary formatting

      •   Indentation not enforced

      •   Hard to see the structure

  •   Accident-prone

                                      2
Case in point
                3
Case in point
                3
CSS is not much better

  •   More repetition

      •   Nested Selectors

      •   padding-left, padding-right, etc.

  •   No consistent formatting




                                              4
Haml and Sass to the rescue!
                               5
What is Haml?

•   XHTML Abstraction Markup Language

•   Markup that describes XHTML

•   Nesting through indentation (like Python)

•   Convenient shortcuts for common elements and attributes

•   Guiding principle: Markup should be beautiful



                                                              6
What is Sass?

•   CSS compliment to Haml

•   Nesting through indentation

•   Named constants

•   Calculated values




                                  7
Examples



           8
XHTML
<!DOCTYPE html PUBLIC quot;-//W3C//DTD XHTML 1.0 Transitional//ENquot; quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtdquot;>
<html lang=”en” xml:lang=”en” xmlns=”http://www.w3.org/1999/xhtml”>
    <head>
        <title>XHTML Example</title>
    </head>
    <body>
        <div id=”container”>
            <div id=”header”>
                <h1 class=”pagetitle”>XHTML Example</h1>
            </div>
            <div id=”content”>
                <span class=”announcement”>BarCamp is coming to Nashville on August 18th!</span>
                <p class=”normaltext”>Lorem ipsum...</p>
            </div>
            <div id=”footer”>
                <span class=”copyright”>(c) 2007 Example Industries</span>
            </div>
        </div>
    </body>
</html>




                                                                                                                            9
XHTML (even uglier, but legal)
<!DOCTYPE html PUBLIC quot;-//W3C//DTD XHTML 1.0 Transitional//ENquot; quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtdquot;>
<html lang=”en” xml:lang=”en” xmlns=”http://www.w3.org/1999/xhtml”><head>
<title>XHTML Example</title></head>
<body>
    <div id=”container”><div id=”header”>
            <h1 class=”pagetitle”>XHTML Example</h1>
            </div>
<div id=”content”>
    <span class=”announcement”>BarCamp is coming to Nashville on August 18th!</span><p class=”normaltext”>Lorem ipsum...
    </p>
</div>

    <div id=”footer”><span class=”copyright”>
        (c) 2007 Example Industries</span></div>
</div>
            </body>
</html>




                                                                                                                            10
Haml
!!!
%html{ :lang => ”en”, ‘xml:lang’ => ”en”, :xmlns => ”http://www.w3.org/1999/xhtml” }
  %head
    %title Haml Example
  %body
    #container
      #header
        %h1.pagetitle Haml Example
      #content
        %span.announcement BarCamp is coming to Nashville on August 18th!
        %p.normaltext Lorem ipsum...
      #footer
        %span.copyright (c) 2007 Example Industries




                                                                                       11
CSS
body {
  font-family: Helvetica, Arial, sans-serif;
  font-size: .8em;
  background-color: #ffffff;
}
a{
  text-decoration: none;
  color: #00ff00;
}
a:hover {
  text-decoration: underline;
  color: #0000ff;
}
#container {
  width: 760px;
}
#header {
  border-bottom: 1px solid #000000;
  border-top: 1px solid #000000;
  background-color: #ff0000;
}
#header h1 {
  font-size: 1.5em;
  font-weight: bold;
}
#footer {
  font-size: .5em;
  background-color: #ff0000;
}
.copyright {
  font-style: italic;
}




                                               12
Sass
!highlight = #ff0000
!headborder = #000000

body
  :font
     :family Helvetica, Arial, sans-serif
     :size .8em
  :background-color #ffffff
a
  :text-decoration none
  :color #00ff00
  &:hover
     :text-decoration underline
     :color #0000ff
#container
  :width 760px
#header
  :border
     :bottom 1px solid !headborder
     :top 1px solid !headborder
  :background-color !highlight
  h1
     :font
       :size 1.5em
       :weight bold
#footer
  :font-size .5em
  :background-color: !highlight
.copyright
  :font-style italic




                                            13
Drawbacks


•   Another markup syntax to learn... but it’s easy.

•   Ruby (on Rails) only... for now

•   Speed... but it doesn’t matter




                                                       14
Learn more


http://haml.hamptoncatlin.com




                                15

Contenu connexe

En vedette

08 17 07
08 17 0708 17 07
08 17 07craigh
 
Meu Brasil
Meu BrasilMeu Brasil
Meu Brasillucciano
 
Alumnos Que Ingresaron En 2004
Alumnos Que Ingresaron En 2004Alumnos Que Ingresaron En 2004
Alumnos Que Ingresaron En 2004enpatagoniasur
 
杜拜除帆船飯店外還有更棒的
杜拜除帆船飯店外還有更棒的杜拜除帆船飯店外還有更棒的
杜拜除帆船飯店外還有更棒的honan4108
 
Mobile Monday Delhi - Fourth Edition
Mobile Monday Delhi - Fourth EditionMobile Monday Delhi - Fourth Edition
Mobile Monday Delhi - Fourth EditionAmit Ranjan
 
健保花費
健保花費健保花費
健保花費honan4108
 

En vedette (7)

08 17 07
08 17 0708 17 07
08 17 07
 
Meu Brasil
Meu BrasilMeu Brasil
Meu Brasil
 
Alumnos Que Ingresaron En 2004
Alumnos Que Ingresaron En 2004Alumnos Que Ingresaron En 2004
Alumnos Que Ingresaron En 2004
 
杜拜除帆船飯店外還有更棒的
杜拜除帆船飯店外還有更棒的杜拜除帆船飯店外還有更棒的
杜拜除帆船飯店外還有更棒的
 
Mobile Monday Delhi - Fourth Edition
Mobile Monday Delhi - Fourth EditionMobile Monday Delhi - Fourth Edition
Mobile Monday Delhi - Fourth Edition
 
健保花費
健保花費健保花費
健保花費
 
Dios te dice
Dios te diceDios te dice
Dios te dice
 

Similaire à Haml And Sass: Put your markup on a diet

Html Css
Html CssHtml Css
Html Csspumas26
 
HTML5 and CSS3 for Teachers
HTML5 and CSS3 for TeachersHTML5 and CSS3 for Teachers
HTML5 and CSS3 for TeachersJason Hando
 
Haml And Sass
Haml And SassHaml And Sass
Haml And Sasswear
 
Killing the Angle Bracket
Killing the Angle BracketKilling the Angle Bracket
Killing the Angle Bracketjnewmanux
 
Html5, css3, canvas, svg and webgl
Html5, css3, canvas, svg and webglHtml5, css3, canvas, svg and webgl
Html5, css3, canvas, svg and webglKilian Valkhof
 
Web Design Bootcamp - Day1
Web Design Bootcamp - Day1Web Design Bootcamp - Day1
Web Design Bootcamp - Day1Aslam Najeebdeen
 
Standardizing the Web: A Look into the Why of Web Standards
Standardizing the Web: A Look into the Why of Web StandardsStandardizing the Web: A Look into the Why of Web Standards
Standardizing the Web: A Look into the Why of Web StandardsTim Wright
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Railsdosire
 
Choosing a Templating System
Choosing a Templating SystemChoosing a Templating System
Choosing a Templating SystemPerrin Harkins
 
01 Introduction To CSS
01 Introduction To CSS01 Introduction To CSS
01 Introduction To CSScrgwbr
 
HTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptHTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptraghavanp4
 
Responsive Web Design & Typography
Responsive Web Design & TypographyResponsive Web Design & Typography
Responsive Web Design & TypographyDanny Calders
 
Basics of Rich Internet Applications
Basics of Rich Internet ApplicationsBasics of Rich Internet Applications
Basics of Rich Internet ApplicationsSubramanyan Murali
 

Similaire à Haml And Sass: Put your markup on a diet (20)

Html Css
Html CssHtml Css
Html Css
 
HTML5 and CSS3 for Teachers
HTML5 and CSS3 for TeachersHTML5 and CSS3 for Teachers
HTML5 and CSS3 for Teachers
 
Haml And Sass
Haml And SassHaml And Sass
Haml And Sass
 
Killing the Angle Bracket
Killing the Angle BracketKilling the Angle Bracket
Killing the Angle Bracket
 
Html5, css3, canvas, svg and webgl
Html5, css3, canvas, svg and webglHtml5, css3, canvas, svg and webgl
Html5, css3, canvas, svg and webgl
 
Web Design Bootcamp - Day1
Web Design Bootcamp - Day1Web Design Bootcamp - Day1
Web Design Bootcamp - Day1
 
Standardizing the Web: A Look into the Why of Web Standards
Standardizing the Web: A Look into the Why of Web StandardsStandardizing the Web: A Look into the Why of Web Standards
Standardizing the Web: A Look into the Why of Web Standards
 
Markup As An Api
Markup As An ApiMarkup As An Api
Markup As An Api
 
Professional Css
Professional CssProfessional Css
Professional Css
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Rails
 
The Future of CSS
The Future of CSSThe Future of CSS
The Future of CSS
 
Choosing a Templating System
Choosing a Templating SystemChoosing a Templating System
Choosing a Templating System
 
01 Introduction To CSS
01 Introduction To CSS01 Introduction To CSS
01 Introduction To CSS
 
HTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptHTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.ppt
 
css.ppt
css.pptcss.ppt
css.ppt
 
css.ppt
css.pptcss.ppt
css.ppt
 
Html frames
Html framesHtml frames
Html frames
 
Responsive Web Design & Typography
Responsive Web Design & TypographyResponsive Web Design & Typography
Responsive Web Design & Typography
 
Basics of Rich Internet Applications
Basics of Rich Internet ApplicationsBasics of Rich Internet Applications
Basics of Rich Internet Applications
 
Html css
Html cssHtml css
Html css
 

Dernier

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 

Dernier (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

Haml And Sass: Put your markup on a diet

  • 1. Haml and Sass Put your markup on a diet 1
  • 2. (X)HTML is unwieldy • Repetition • Closing tags • id and class everywhere • Arbitrary formatting • Indentation not enforced • Hard to see the structure • Accident-prone 2
  • 5. CSS is not much better • More repetition • Nested Selectors • padding-left, padding-right, etc. • No consistent formatting 4
  • 6. Haml and Sass to the rescue! 5
  • 7. What is Haml? • XHTML Abstraction Markup Language • Markup that describes XHTML • Nesting through indentation (like Python) • Convenient shortcuts for common elements and attributes • Guiding principle: Markup should be beautiful 6
  • 8. What is Sass? • CSS compliment to Haml • Nesting through indentation • Named constants • Calculated values 7
  • 10. XHTML <!DOCTYPE html PUBLIC quot;-//W3C//DTD XHTML 1.0 Transitional//ENquot; quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtdquot;> <html lang=”en” xml:lang=”en” xmlns=”http://www.w3.org/1999/xhtml”> <head> <title>XHTML Example</title> </head> <body> <div id=”container”> <div id=”header”> <h1 class=”pagetitle”>XHTML Example</h1> </div> <div id=”content”> <span class=”announcement”>BarCamp is coming to Nashville on August 18th!</span> <p class=”normaltext”>Lorem ipsum...</p> </div> <div id=”footer”> <span class=”copyright”>(c) 2007 Example Industries</span> </div> </div> </body> </html> 9
  • 11. XHTML (even uglier, but legal) <!DOCTYPE html PUBLIC quot;-//W3C//DTD XHTML 1.0 Transitional//ENquot; quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtdquot;> <html lang=”en” xml:lang=”en” xmlns=”http://www.w3.org/1999/xhtml”><head> <title>XHTML Example</title></head> <body> <div id=”container”><div id=”header”> <h1 class=”pagetitle”>XHTML Example</h1> </div> <div id=”content”> <span class=”announcement”>BarCamp is coming to Nashville on August 18th!</span><p class=”normaltext”>Lorem ipsum... </p> </div> <div id=”footer”><span class=”copyright”> (c) 2007 Example Industries</span></div> </div> </body> </html> 10
  • 12. Haml !!! %html{ :lang => ”en”, ‘xml:lang’ => ”en”, :xmlns => ”http://www.w3.org/1999/xhtml” } %head %title Haml Example %body #container #header %h1.pagetitle Haml Example #content %span.announcement BarCamp is coming to Nashville on August 18th! %p.normaltext Lorem ipsum... #footer %span.copyright (c) 2007 Example Industries 11
  • 13. CSS body { font-family: Helvetica, Arial, sans-serif; font-size: .8em; background-color: #ffffff; } a{ text-decoration: none; color: #00ff00; } a:hover { text-decoration: underline; color: #0000ff; } #container { width: 760px; } #header { border-bottom: 1px solid #000000; border-top: 1px solid #000000; background-color: #ff0000; } #header h1 { font-size: 1.5em; font-weight: bold; } #footer { font-size: .5em; background-color: #ff0000; } .copyright { font-style: italic; } 12
  • 14. Sass !highlight = #ff0000 !headborder = #000000 body :font :family Helvetica, Arial, sans-serif :size .8em :background-color #ffffff a :text-decoration none :color #00ff00 &:hover :text-decoration underline :color #0000ff #container :width 760px #header :border :bottom 1px solid !headborder :top 1px solid !headborder :background-color !highlight h1 :font :size 1.5em :weight bold #footer :font-size .5em :background-color: !highlight .copyright :font-style italic 13
  • 15. Drawbacks • Another markup syntax to learn... but it’s easy. • Ruby (on Rails) only... for now • Speed... but it doesn’t matter 14