SlideShare une entreprise Scribd logo
1  sur  40
QUICKLY SASS AND HAML
border-radius: 25px;
border-radius: 25px;
-moz-border-radius: 25px;
-webkit-border-radius: 25px;
-o-border-radius: 25px;
-ms-border-radius: 25px;
-khtml-border-radius: 25px;
SASS


• Keep   your CSS in order

• Easy   to read

• Faster   to code

• DRY
• Variables

• Inheritance

• Mixins

• Operations

• Flow   control
SASS Y SCSS
    SASS                             SCSS
$txt-size:13px                 $txt-size:13px;
$txt-color:white               $txt-color:white;

#main                          #main{
  :font-size $txt-size           font-size:$txt-size;
  :color $txt-color              color:$txt-color;
  a                              a{
    :text-decoration:none           text-decoration:none;
                                 }
                               }
SASS Y SCSS
    SASS                             SCSS
$txt-size:13px                 $txt-size:13px;
$txt-color:white               $txt-color:white;

#main                          #main{
  :font-size $txt-size           font-size:$txt-size;
  :color $txt-color              color:$txt-color;
  a                              a{
    :text-decoration:none           text-decoration:none;
                                 }
                               }
SASS Y SCSS
    SASS                    #main{
                              font-size:13px;
                                                            SCSS
                              color:white;
                            }
$txt-size:13px                                        $txt-size:13px;
$txt-color:white            #main a{                  $txt-color:white;
                              text-decoration:none;
#main                       }                         #main{
  :font-size $txt-size                                  font-size:$txt-size;
  :color $txt-color                                     color:$txt-color;
  a                                                     a{
    :text-decoration:none                                  text-decoration:none;
                                                        }
                                                      }
SASS Y SCSS
    SASS                    #main{
                              font-size:13px;
                                                            SCSS
                              color:white;
                            }
$txt-size:13px                                        $txt-size:13px;
$txt-color:white            #main a{                  $txt-color:white;
                              text-decoration:none;
#main                       }                         #main{
  :font-size $txt-size                                  font-size:$txt-size;
  :color $txt-color                                     color:$txt-color;
  a                                                     a{
    :text-decoration:none                                  text-decoration:none;
                                                        }
                                                      }
SASS Y SCSS
    SASS                    #main{
                              font-size:13px;
                                                            SCSS
                              color:white;
                            }
$txt-size:13px                                        $txt-size:13px;
$txt-color:white            #main a{                  $txt-color:white;
                              text-decoration:none;
#main                       }                         #main{
  :font-size $txt-size                                  font-size:$txt-size;
  :color $txt-color                                     color:$txt-color;
  a                                                     a{
    :text-decoration:none                                  text-decoration:none;
                                                        }
                                                      }
SASS Y SCSS
    SASS                    #main{
                              font-size:13px;
                                                            SCSS
                              color:white;
                            }
$txt-size:13px                                        $txt-size:13px;
$txt-color:white            #main a{                  $txt-color:white;
                              text-decoration:none;
#main                       }                         #main{
  :font-size $txt-size                                  font-size:$txt-size;
  :color $txt-color                                     color:$txt-color;
  a                                                     a{
    :text-decoration:none                                  text-decoration:none;
                                                        }
                                                      }
SASS Y SCSS
    SASS                    #main{
                              font-size:13px;
                                                            SCSS
                              color:white;
                            }
$txt-size:13px                                        $txt-size:13px;
$txt-color:white            #main a{                  $txt-color:white;
                              text-decoration:none;
#main                       }                         #main{
  :font-size $txt-size                                  font-size:$txt-size;
  :color $txt-color                                     color:$txt-color;
  a                                                     a{
    :text-decoration:none                                  text-decoration:none;
                                                        }
                                                      }
SASS Y SCSS
    SASS                    #main{
                              font-size:13px;
                                                            SCSS
                              color:white;
                            }
$txt-size:13px                                        $txt-size:13px;
$txt-color:white            #main a{                  $txt-color:white;
                              text-decoration:none;
#main                       }                         #main{
  :font-size $txt-size                                  font-size:$txt-size;
  :color $txt-color                                     color:$txt-color;
  a                                                     a{
    :text-decoration:none                                  text-decoration:none;
                                                        }
                                                      }
SASS Y SCSS
    SASS                    #main{
                              font-size:13px;
                                                            SCSS
                              color:white;
                            }
$txt-size:13px                                        $txt-size:13px;
$txt-color:white            #main a{                  $txt-color:white;
                              text-decoration:none;
#main                       }                         #main{
  :font-size $txt-size                                  font-size:$txt-size;
  :color $txt-color                                     color:$txt-color;
  a                                                     a{
    :text-decoration:none                                  text-decoration:none;
                                                        }
                                                      }
@EXTEND
.alert{
  background:blue;
  font-size:1em;
}

.error{
  @extend .alert;
  color:red;
}
@EXTEND
.alert{
  background:blue;
  font-size:1em;
}

.error{
  @extend .alert;
  color:red;
}
@EXTEND
                               .alert .error{
.alert{
                                 color:red;
  background:blue;
                               }
  font-size:1em;
}
                               .alert{
                                 background:blue;
.error{
                                 font-size:1em;
  @extend .alert;
                               }
  color:red;
}
@EXTEND
                               .alert .error{
.alert{
                                 color:red;
  background:blue;
                               }
  font-size:1em;
}
                               .alert{
                                 background:blue;
.error{
                                 font-size:1em;
  @extend .alert;
                               }
  color:red;
}
REFERENCE TO PARENT “&”
.alert{
  background:blue;
  font-size:1em;
  & a{
     color:red;
  }
}
REFERENCE TO PARENT “&”
                     .alert{
.alert{                background:blue;
  background:blue;     font-size:1em;
  font-size:1em;     }
  & a{               .alert a{
     color:red;        color:red;
  }                  }
}
REFERENCE TO PARENT “&”
                     .alert{
.alert{                background:blue;
  background:blue;     font-size:1em;
  font-size:1em;     }
  & a{               .alert a{
     color:red;        color:red;
  }                  }
}
MIXINS
                                .notice {
@mixin fanncy-box(){              @include fancy-box();
  @include borde-radius(5px);     color:white;
  background:blue;              }
}                               .comment {
                                  @include fancy-box();
                                  color:black;
                                }
MIXINS                  .notice{
                                                          -moz-border-radius: 25px;
                                                          -webkit-border-radius: 5px;
                                                          -o-border-radius: 5px;
                                .notice {
                                                          -ms-border-radius: 5px;
@mixin fanncy-box(){              @include fancy-box();
                                                          -khtml-border-radius: 5px;
  @include borde-radius(5px);     color:white;
                                                          border-radius: 5px;
  background:blue;              }
                                                          color:white;
}                               .comment {
                                                        }
                                  @include fancy-box();
                                  color:black;
                                                        .comment{
                                }
                                                          -moz-border-radius: 25px;
                                                          -webkit-border-radius: 5px;
                                                          -o-border-radius: 5px;
                                                          -ms-border-radius: 5px;
                                                          -khtml-border-radius: 5px;
                                                          border-radius: 5px;
                                                          color:black;
                                                        }
@mixin fanncy-box($color: #FFFFFF){
  @include borde-radius(5px);
  background:blue;
  color:$color;
}
@mixin fanncy-box($color: #FFFFFF){
  @include borde-radius(5px);
  background:blue;
  color:$color;
}


      .notice {
        @include fancy-box(#CCCCCC);
      }
      .comment {
        @include fancy-box(#000000);
      }
@mixin fanncy-box($color: #FFFFFF){
  @include borde-radius(5px);
  background:blue;
  color:$color;
}


      .notice {
        @include fancy-box(#CCCCCC);
      }
      .comment {                       .notice{
        @include fancy-box(#000000);     -moz-border-radius: 25px;
      }                                  -webkit-border-radius: 5px;
                                         -o-border-radius: 5px;
                                         -ms-border-radius: 5px;
                                         -khtml-border-radius: 5px;
                                         border-radius: 5px;
                                         color:#CCCCCC;
                                       }

                                       .comment{
                                         -moz-border-radius: 25px;
                                         -webkit-border-radius: 5px;
                                         -o-border-radius: 5px;
                                         -ms-border-radius: 5px;
                                         -khtml-border-radius: 5px;
                                         border-radius: 5px;
                                         color:#000000;
                                       }
@mixin fanncy-box($color: #FFFFFF){
  @include borde-radius(5px);
  background:blue;
  color:$color;
}


      .notice {
        @include fancy-box(#CCCCCC);
      }
      .comment {                       .notice{
        @include fancy-box(#000000);     -moz-border-radius: 25px;
      }                                  -webkit-border-radius: 5px;
                                         -o-border-radius: 5px;
                                         -ms-border-radius: 5px;
                                         -khtml-border-radius: 5px;
                                         border-radius: 5px;
                                         color:#CCCCCC;
                                       }

                                       .comment{
                                         -moz-border-radius: 25px;
                                         -webkit-border-radius: 5px;
                                         -o-border-radius: 5px;
                                         -ms-border-radius: 5px;
                                         -khtml-border-radius: 5px;
                                         border-radius: 5px;
                                         color:#000000;
                                       }
HAML

• “Markup  should be
 beautiful”

• Easier   to reed

• No   closing tags. #epicwin

• Reduce    the length of your
 views
BASICALLY
<body>                              %body
  <div id="container">                #container
    <p>this is some text</p>            %p this is some text
  </div>
</body>
BASICALLY
<body>                              %body
  <div id="container">                #container
    <p>this is some text</p>            %p this is some text
  </div>
</body>




                               2px indentation
HAML                  HTML

                     • <body></bodye>
• %body                                           •
                     • <divclass=‘container’></
• .container          container>                  •

• %section.red-one   • <section
                              class=‘red-         •
                      one’></section>
HAML                     HTML

                                                 •
• %a{:href   => ‘#’} a   • <a   href=’#’>a</a>
                                                 •
• %a{href    = ‘#’} b    • <a   href=’#’>b</a>
                                                 •
RUBY CODE
                         <p>hola<p>
- 5.times do             <p>hola<p>
  %p hola                <p>hola<p>
                         <p>hola<p>
%p= “hola” * 5           <p>hola<p>

                         <p>hola hola hola hola
                         hola</p>
RUBY CODE
                                          <p>hola<p>
- 5.times do                              <p>hola<p>
  %p hola                                 <p>hola<p>
                                          <p>hola<p>
%p= “hola” * 5                            <p>hola<p>

                                          <p>hola hola hola hola
                                          hola</p>




                  - ruby code without output

                 = output to the renderer html
RUBY CODE INTERPOLATION
- name = ‘Hector’           <p>yo me llamo Hector<p>

%p yo me llamo #{name}

%p= “yo me llamo #{name}”
FILTERS
• Starts   with “:” and have idented code

• There’s   a lot almost for everything you want

  • :javascript, :css, :ruby, :plain, :escaped, :sass

• And   also you can create your own
:JAVASCRIPT
:javascript                      <script>
  alert(‘waazuuup’);             //<![CDATA][
                                   alert(‘waazuuup’);
                                 //]]>
                                 </script>
DOCTYPE?
                        <!DOCTYPE html>
!!! 5                   <head>
%head                   </head>
%body                   <body>
  %section                <section></section>
                        </body>
Quickly Haml and Sass

Contenu connexe

Similaire à Quickly Haml and Sass

Stylesheets of the future with Sass and Compass
Stylesheets of the future with Sass and CompassStylesheets of the future with Sass and Compass
Stylesheets of the future with Sass and CompassDave Ross
 
Save time by using SASS/SCSS
Save time by using SASS/SCSSSave time by using SASS/SCSS
Save time by using SASS/SCSSBerit Hlubek
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008tutorialsruby
 
Sassive Aggressive: Using Sass to Make Your Life Easier (NSWG Version)
Sassive Aggressive: Using Sass to Make Your Life Easier (NSWG Version)Sassive Aggressive: Using Sass to Make Your Life Easier (NSWG Version)
Sassive Aggressive: Using Sass to Make Your Life Easier (NSWG Version)Adam Darowski
 
CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書拓樹 谷
 
Sass and Compass - Getting Started
Sass and Compass - Getting StartedSass and Compass - Getting Started
Sass and Compass - Getting Startededgincvg
 
Work and play with SASS & Compass
Work and play with SASS & CompassWork and play with SASS & Compass
Work and play with SASS & CompassAndreas Dantz
 
Pacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASSPacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASSSteve Krueger
 
CSS3 is Not Magic Pixie Dust
CSS3 is Not Magic Pixie DustCSS3 is Not Magic Pixie Dust
CSS3 is Not Magic Pixie DustKyle Adams
 
Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)emrox
 
Wrangling the CSS Beast with Sass
Wrangling the CSS Beast  with SassWrangling the CSS Beast  with Sass
Wrangling the CSS Beast with SassRob Friesel
 

Similaire à Quickly Haml and Sass (15)

FCIP SASS Talk
FCIP SASS TalkFCIP SASS Talk
FCIP SASS Talk
 
Stylesheets of the future with Sass and Compass
Stylesheets of the future with Sass and CompassStylesheets of the future with Sass and Compass
Stylesheets of the future with Sass and Compass
 
Save time by using SASS/SCSS
Save time by using SASS/SCSSSave time by using SASS/SCSS
Save time by using SASS/SCSS
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
Less & Sass
Less & SassLess & Sass
Less & Sass
 
Sassive Aggressive: Using Sass to Make Your Life Easier (NSWG Version)
Sassive Aggressive: Using Sass to Make Your Life Easier (NSWG Version)Sassive Aggressive: Using Sass to Make Your Life Easier (NSWG Version)
Sassive Aggressive: Using Sass to Make Your Life Easier (NSWG Version)
 
Less css
Less cssLess css
Less css
 
CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書CSSプリプロセッサの取扱説明書
CSSプリプロセッサの取扱説明書
 
Sass and Compass - Getting Started
Sass and Compass - Getting StartedSass and Compass - Getting Started
Sass and Compass - Getting Started
 
Work and play with SASS & Compass
Work and play with SASS & CompassWork and play with SASS & Compass
Work and play with SASS & Compass
 
Pacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASSPacific Northwest Drupal Summit: Basic & SASS
Pacific Northwest Drupal Summit: Basic & SASS
 
CSS3 is Not Magic Pixie Dust
CSS3 is Not Magic Pixie DustCSS3 is Not Magic Pixie Dust
CSS3 is Not Magic Pixie Dust
 
Theming and Sass
Theming and SassTheming and Sass
Theming and Sass
 
Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)
 
Wrangling the CSS Beast with Sass
Wrangling the CSS Beast  with SassWrangling the CSS Beast  with Sass
Wrangling the CSS Beast with Sass
 

Dernier

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
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
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
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
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
 
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
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Dernier (20)

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
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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
 
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, ...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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
 
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
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Quickly Haml and Sass

  • 3. border-radius: 25px; -moz-border-radius: 25px; -webkit-border-radius: 25px; -o-border-radius: 25px; -ms-border-radius: 25px; -khtml-border-radius: 25px;
  • 4.
  • 5. SASS • Keep your CSS in order • Easy to read • Faster to code • DRY
  • 6. • Variables • Inheritance • Mixins • Operations • Flow control
  • 7. SASS Y SCSS SASS SCSS $txt-size:13px $txt-size:13px; $txt-color:white $txt-color:white; #main #main{ :font-size $txt-size font-size:$txt-size; :color $txt-color color:$txt-color; a a{ :text-decoration:none text-decoration:none; } }
  • 8. SASS Y SCSS SASS SCSS $txt-size:13px $txt-size:13px; $txt-color:white $txt-color:white; #main #main{ :font-size $txt-size font-size:$txt-size; :color $txt-color color:$txt-color; a a{ :text-decoration:none text-decoration:none; } }
  • 9. SASS Y SCSS SASS #main{ font-size:13px; SCSS color:white; } $txt-size:13px $txt-size:13px; $txt-color:white #main a{ $txt-color:white; text-decoration:none; #main } #main{ :font-size $txt-size font-size:$txt-size; :color $txt-color color:$txt-color; a a{ :text-decoration:none text-decoration:none; } }
  • 10. SASS Y SCSS SASS #main{ font-size:13px; SCSS color:white; } $txt-size:13px $txt-size:13px; $txt-color:white #main a{ $txt-color:white; text-decoration:none; #main } #main{ :font-size $txt-size font-size:$txt-size; :color $txt-color color:$txt-color; a a{ :text-decoration:none text-decoration:none; } }
  • 11. SASS Y SCSS SASS #main{ font-size:13px; SCSS color:white; } $txt-size:13px $txt-size:13px; $txt-color:white #main a{ $txt-color:white; text-decoration:none; #main } #main{ :font-size $txt-size font-size:$txt-size; :color $txt-color color:$txt-color; a a{ :text-decoration:none text-decoration:none; } }
  • 12. SASS Y SCSS SASS #main{ font-size:13px; SCSS color:white; } $txt-size:13px $txt-size:13px; $txt-color:white #main a{ $txt-color:white; text-decoration:none; #main } #main{ :font-size $txt-size font-size:$txt-size; :color $txt-color color:$txt-color; a a{ :text-decoration:none text-decoration:none; } }
  • 13. SASS Y SCSS SASS #main{ font-size:13px; SCSS color:white; } $txt-size:13px $txt-size:13px; $txt-color:white #main a{ $txt-color:white; text-decoration:none; #main } #main{ :font-size $txt-size font-size:$txt-size; :color $txt-color color:$txt-color; a a{ :text-decoration:none text-decoration:none; } }
  • 14. SASS Y SCSS SASS #main{ font-size:13px; SCSS color:white; } $txt-size:13px $txt-size:13px; $txt-color:white #main a{ $txt-color:white; text-decoration:none; #main } #main{ :font-size $txt-size font-size:$txt-size; :color $txt-color color:$txt-color; a a{ :text-decoration:none text-decoration:none; } }
  • 15. SASS Y SCSS SASS #main{ font-size:13px; SCSS color:white; } $txt-size:13px $txt-size:13px; $txt-color:white #main a{ $txt-color:white; text-decoration:none; #main } #main{ :font-size $txt-size font-size:$txt-size; :color $txt-color color:$txt-color; a a{ :text-decoration:none text-decoration:none; } }
  • 16. @EXTEND .alert{ background:blue; font-size:1em; } .error{ @extend .alert; color:red; }
  • 17. @EXTEND .alert{ background:blue; font-size:1em; } .error{ @extend .alert; color:red; }
  • 18. @EXTEND .alert .error{ .alert{ color:red; background:blue; } font-size:1em; } .alert{ background:blue; .error{ font-size:1em; @extend .alert; } color:red; }
  • 19. @EXTEND .alert .error{ .alert{ color:red; background:blue; } font-size:1em; } .alert{ background:blue; .error{ font-size:1em; @extend .alert; } color:red; }
  • 20. REFERENCE TO PARENT “&” .alert{ background:blue; font-size:1em; & a{ color:red; } }
  • 21. REFERENCE TO PARENT “&” .alert{ .alert{ background:blue; background:blue; font-size:1em; font-size:1em; } & a{ .alert a{ color:red; color:red; } } }
  • 22. REFERENCE TO PARENT “&” .alert{ .alert{ background:blue; background:blue; font-size:1em; font-size:1em; } & a{ .alert a{ color:red; color:red; } } }
  • 23. MIXINS .notice { @mixin fanncy-box(){ @include fancy-box(); @include borde-radius(5px); color:white; background:blue; } } .comment { @include fancy-box(); color:black; }
  • 24. MIXINS .notice{ -moz-border-radius: 25px; -webkit-border-radius: 5px; -o-border-radius: 5px; .notice {   -ms-border-radius: 5px; @mixin fanncy-box(){ @include fancy-box();   -khtml-border-radius: 5px; @include borde-radius(5px); color:white;   border-radius: 5px; background:blue; } color:white; } .comment { } @include fancy-box(); color:black; .comment{ } -moz-border-radius: 25px; -webkit-border-radius: 5px; -o-border-radius: 5px;   -ms-border-radius: 5px;   -khtml-border-radius: 5px;   border-radius: 5px; color:black; }
  • 25. @mixin fanncy-box($color: #FFFFFF){ @include borde-radius(5px); background:blue; color:$color; }
  • 26. @mixin fanncy-box($color: #FFFFFF){ @include borde-radius(5px); background:blue; color:$color; } .notice { @include fancy-box(#CCCCCC); } .comment { @include fancy-box(#000000); }
  • 27. @mixin fanncy-box($color: #FFFFFF){ @include borde-radius(5px); background:blue; color:$color; } .notice { @include fancy-box(#CCCCCC); } .comment { .notice{ @include fancy-box(#000000); -moz-border-radius: 25px; } -webkit-border-radius: 5px; -o-border-radius: 5px;   -ms-border-radius: 5px;   -khtml-border-radius: 5px;   border-radius: 5px; color:#CCCCCC; } .comment{ -moz-border-radius: 25px; -webkit-border-radius: 5px; -o-border-radius: 5px;   -ms-border-radius: 5px;   -khtml-border-radius: 5px;   border-radius: 5px; color:#000000; }
  • 28. @mixin fanncy-box($color: #FFFFFF){ @include borde-radius(5px); background:blue; color:$color; } .notice { @include fancy-box(#CCCCCC); } .comment { .notice{ @include fancy-box(#000000); -moz-border-radius: 25px; } -webkit-border-radius: 5px; -o-border-radius: 5px;   -ms-border-radius: 5px;   -khtml-border-radius: 5px;   border-radius: 5px; color:#CCCCCC; } .comment{ -moz-border-radius: 25px; -webkit-border-radius: 5px; -o-border-radius: 5px;   -ms-border-radius: 5px;   -khtml-border-radius: 5px;   border-radius: 5px; color:#000000; }
  • 29. HAML • “Markup should be beautiful” • Easier to reed • No closing tags. #epicwin • Reduce the length of your views
  • 30. BASICALLY <body> %body <div id="container"> #container <p>this is some text</p> %p this is some text </div> </body>
  • 31. BASICALLY <body> %body <div id="container"> #container <p>this is some text</p> %p this is some text </div> </body> 2px indentation
  • 32. HAML HTML • <body></bodye> • %body • • <divclass=‘container’></ • .container container> • • %section.red-one • <section class=‘red- • one’></section>
  • 33. HAML HTML • • %a{:href => ‘#’} a • <a href=’#’>a</a> • • %a{href = ‘#’} b • <a href=’#’>b</a> •
  • 34. RUBY CODE <p>hola<p> - 5.times do <p>hola<p> %p hola <p>hola<p> <p>hola<p> %p= “hola” * 5 <p>hola<p> <p>hola hola hola hola hola</p>
  • 35. RUBY CODE <p>hola<p> - 5.times do <p>hola<p> %p hola <p>hola<p> <p>hola<p> %p= “hola” * 5 <p>hola<p> <p>hola hola hola hola hola</p> - ruby code without output = output to the renderer html
  • 36. RUBY CODE INTERPOLATION - name = ‘Hector’ <p>yo me llamo Hector<p> %p yo me llamo #{name} %p= “yo me llamo #{name}”
  • 37. FILTERS • Starts with “:” and have idented code • There’s a lot almost for everything you want • :javascript, :css, :ruby, :plain, :escaped, :sass • And also you can create your own
  • 38. :JAVASCRIPT :javascript <script> alert(‘waazuuup’); //<![CDATA][ alert(‘waazuuup’); //]]> </script>
  • 39. DOCTYPE? <!DOCTYPE html> !!! 5 <head> %head </head> %body <body> %section <section></section> </body>

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n