SlideShare a Scribd company logo
20013/04/17




 20x20                   Less VS Sass
                            Mine is Longer...




                             Hoang C. Huynh
                                    @aetheros

mercoledì 17 aprile 13
Less VS Sass                           2




                         WE ALL   STANDARDS




mercoledì 17 aprile 13
Less VS Sass                                          3




                         Historical Outcomes
                         §   Fragmentation
                         §   Inconsistency
                         §   Vendor Captivity
                         §   “Wish I Could” Syndrome
                               §   Variables
                               §   Object Oriented
                               §   Inheritance
                               §   Functions
                               §   Business Logic




                              CSS’ TROUBLESOME YOUTH


mercoledì 17 aprile 13
Less VS Sass                                                                 4




                         http://lesscss.org/        http://sass-lang.com/
                            2009 - Alexis Sellier      2007 - Hampton Catlin

        § These are not frameworks nor toolkits.
        § These are preprocessors, that try to fill the gaps
                present in the standard CSS development

    What we are talking about?                        Code Less, Code Better

mercoledì 17 aprile 13
FIrst Thing FIrst                                                                       5




                                                                    WHY PREPROCESS?


     § Error Detection
             Misplaced {}, missing commas, misspelled attributes or inconsistent values

     § Code Minification
             Compact of Selector and shorthand values, comments and spaces discard

     § Code Organization
             Physical inclusion of files, namespacing, folder organization

     § Customization


mercoledì 17 aprile 13
FIrst Thing FIrst                                                   6




                                                         WHY PREPROCESS?


    § Write less code and follow DRY principles
    § Write maintainable code and, hopefully,
            more readable ( ...it’s not easy to get both... )
    § Juggle complexity and bounce it back to
            who’s “able” to handle it
    § Power and Flexibility

mercoledì 17 aprile 13
Less VS Sass                                                                              7




       §      Mixins: LESS Elements, Less Mixins   §    Mixins: GroundworkCSS, Bourbon
       §      Layout: 960, Frameless, Semantic,    §    Grids: Neat, Gridset, Zen Grids
               Less Framework, Even.less, Centage   §    ...
       §      ...                                  §    Killer Framework: Compass
       §      Killer App: Twitter Bootstrap        §    Killer App: Foundation




                                                         ECOSYSTEM DIFFERENCE


mercoledì 17 aprile 13
Less VS Sass                                                                         8




                         “It’s just CSS”           “It’s more than CSS”

       §      Declarative style of coding    §   Imperative style of coding
       §      CSS Friendly Syntax            §   Compiler Directive
       §      Declare what you want to see   §   Declare how you want things to be
                                                   done


                                              PHILOSOPHICAL DIFFERENCE


mercoledì 17 aprile 13
Less VS Sass                                                                         9




                                                              Oldies but Goodies


      §      SASS is part of the Ruby family    gem install sass
                                                 mv style.css style.scss
      §      Ruby comes with MacOSX
                                                 sass --watch style.scss:style.css


      §      SASS has two syntaxes: SCSS & the former SASS


                   $main_color: #FF03DE;              $main_color: #FF03DE

                   .content-navigation {              .content-navigation
                     border-color: $main_color;         border-color: $main_color
                   }

                                                No handles, no commas, indentation based


mercoledì 17 aprile 13
Less VS Sass                                                                                   10




                                                             WHY AM I SO POPULAR?

      §      LESS is part of the Javascript family    npm install -g less
      §      To compile, Node.JS is required and      lessc -x styles.less > styles.css

              the package is available through NPN


      §      LESS compilers comes in many flavors, even PHP doh!


      §      LESS can run directly on the client browser!

                         <link	
  rel="stylesheet/less"	
  type="text/css"	
  href="styles.less">
                         <script	
  src="less.js"	
  type="text/javascript"></script>

                                       ...WHICH IS THE WORST, but Designers seem to like it...



mercoledì 17 aprile 13
Less VS Sass                                                       11




                                                WHY AM I SO POPULAR?


      § LESS is young and is catching up with SASS very fast,
              fueled by the rapid growth of Node.JS and Bootstrap
      § The LESS universe is lagging behind a lack of syntactic
              polishness and fragmentation of modules, add ons and
              forks, but that it is not definitely a bad thing.
      § Documentation is more noob friendly




mercoledì 17 aprile 13
Less VS Sass                                                           12




                                                            Variables



   @nice-blue: #5B83AD;                $nice-blue: #5B83AD;
   @light-blue: (@nice-blue + #111);   $light-blue: ($nice-blue + #111);

   #header { color: @light-blue; }     #header { color: $light-blue; }




                         #header { color: #6c94be; }

                                                             Winner: TIE


mercoledì 17 aprile 13
Less VS Sass                                                                         13




                                                                                 Nesting

                         table.hl {                     table.hl {
                           margin: 2em 0;                 margin: 2em 0;
       “&” is the
                           &:hover {                      &:hover {
     parent selector         text-align: right;             text-align: right;
                           }                              }
                           li {                           li {
                                                            font: {
                                 font-family: serif;           family: serif;
                                 font-weight: bold;            weight: bold;
                                                            }
                             }                            }
                         }                              }


                             table.hl {                table.hl li {
                               margin: 2em 0;            font-family: serif;
                             }                           font-weight: bold;
                             table.hl:hover {            font-size: 1.2em;
                               text-align: right;      }
                                                                            Winner: SASS
                             }

mercoledì 17 aprile 13
Less VS Sass                                                         14




                                                                  Mixins


  .bordered(@pix: 2px) {               @mixin bordered($pix: 2px) {
    border-top: dotted 1px black;        border-top: dotted 1px black;
    border-bottom: solid @pix black;     border-bottom: solid $pix black;
  }                                    }
  #menu a {                            #menu a {
    .bordered();                         @include bordered();
  }                                    }
  .post a {                            .post a {
    .bordered(4px);                      @include bordered(4px);
  }                                    }


  #menu a {                            .post a {
    border-top: dotted 2px black;        border-top: dotted 2px black;
    border-bottom: solid 4px black;      border-bottom: solid 4px black;
  }                                    }
                                                              Winner: TIE


mercoledì 17 aprile 13
Less VS Sass                                                                            15




                                                                            Inheritance


         .module-a {                                       .module-a {
            color: #123456;                                    color: #123456;
         }                                                 }
         .module-b {{                                      .module-b {
            .module-a();                                      @extend .module-a;
            border: 1px solid red;                           border: 1px solid red;
         }                                                 }
          LESS 1.4 will support the Extend directive
    in the same way that SASS do, but as a pseudoclass




                         .module-a {                     .module-a, .module-b {
                            color: #123456;                color: #123456;
                         }                               }
                         .module-b {                     .module-b {
                           color: #123456;                 border: 1px solid red;
                           border: 1px solid red;        }
                                                                     Winner: SASS (for now)
                         }

mercoledì 17 aprile 13
Less VS Sass                                                                   16




                                                                  Advanced Logic


      §      GUARDED MIXINS                       §   IF ELSE
      .mixin(params) when (dir=top){               @mixin my-mixin($parameters){
          /* Conditional stuff */                     @if $my-parameter == value {
      }                                                   /* Conditional stuff */
                                                      }
                                                   }
      §      RECURSION                            § LOOPS
      .loop(@index) when (@index &gt; 0) {         @for $i from 1 through 10 {
          (~".my-element:nth-child(@{index})") {
              animation-name: "load-@{index}";
                                                     /* My stuff here */
          }                                        }
          .loop(@index - 1);
      }
      .loop (0) {}
                                                   §   CONCATENATION
      @nbElements: 10;                             #{$my-selector} {
      .loop (@nbElements);
                                                      #{$my-property}: $my-value;
      §      NO CONCATENATION                     }
                                                                     Winner: SASS


mercoledì 17 aprile 13
In the End                                                        17




                                         SO? WHICH ONE SHOULD WE PICK?




                         DOES IT REALLY MATTER?
      §      In a couple of month both preprocessors
              will be 90% similar
      §      Know your Client and your project, simply
              pick the one that suits better for thy


mercoledì 17 aprile 13
In the End                                                                                     18




   GRAVE DANGER YOU ARE IN, IMPATIENT YOU ARE

    § Learn / Master CSS first, You must
    § To think re-usable, You have
    § Build Components not Views You will
    § K.I.S.S! Presentation not logic CSS is!


    § Nice SASS / LESS sources can compile in ugly code!

              #dettaglioIniziative #content .vscroller .days li .month .list .activity .hour {
                font-weight: 700; line-height: 50px; font-size: 18px; float: left;
              }



mercoledì 17 aprile 13
In the End                                                                       19




      FInal Takeaway

      For the most of the average designer / developer, the general
      knowledge of a preprocessor should really suffice, so in the end is
      just a matter of preferences. Don’t get cocky and pick the right tool!


               Don’t forget to check sometimes the new hero in town,
                             he may really surprise you :)

                                        border-radius()
                                          -webkit-border-radius arguments
                                          -moz-border-radius arguments
                                          border-radius arguments

                                        body
                                          font 12px Helvetica, Arial, sans-serif

                                        a.button
                                          border-radius 5px



mercoledì 17 aprile 13
Question Time                                            20




                                        Question Time!




                         ...We will be using Boostrap+Sass...
mercoledì 17 aprile 13

More Related Content

More from Hoang Huynh

ITA - Preparare un Workshop con Playmobil.PRO®
ITA - Preparare un Workshop con Playmobil.PRO®ITA - Preparare un Workshop con Playmobil.PRO®
ITA - Preparare un Workshop con Playmobil.PRO®
Hoang Huynh
 
ENG - How to Design a Workshop with Playmobil.PRO®
ENG - How to Design a Workshop with Playmobil.PRO®ENG - How to Design a Workshop with Playmobil.PRO®
ENG - How to Design a Workshop with Playmobil.PRO®
Hoang Huynh
 
ITA - A Personas Primer
ITA - A Personas PrimerITA - A Personas Primer
ITA - A Personas Primer
Hoang Huynh
 
Dont ask for my time - Feedback conversation starter
Dont ask for my time - Feedback conversation starterDont ask for my time - Feedback conversation starter
Dont ask for my time - Feedback conversation starter
Hoang Huynh
 
The Welcome - New recruit welcome speech
The Welcome - New recruit welcome speechThe Welcome - New recruit welcome speech
The Welcome - New recruit welcome speech
Hoang Huynh
 
TAG LateNight - Experience and Digital Transformation -
TAG LateNight - Experience and Digital Transformation - TAG LateNight - Experience and Digital Transformation -
TAG LateNight - Experience and Digital Transformation -
Hoang Huynh
 
Riconoscere e Gestire il Debito UX - Agile Business Day 2016 #ABD16
Riconoscere e Gestire il Debito UX - Agile Business Day 2016 #ABD16Riconoscere e Gestire il Debito UX - Agile Business Day 2016 #ABD16
Riconoscere e Gestire il Debito UX - Agile Business Day 2016 #ABD16
Hoang Huynh
 
Crafting Great Hypotheses - Droidcon 2016
Crafting Great Hypotheses - Droidcon 2016Crafting Great Hypotheses - Droidcon 2016
Crafting Great Hypotheses - Droidcon 2016
Hoang Huynh
 
WIAD16 - L'Architettura dell'Informazione nel Turismo
WIAD16 - L'Architettura dell'Informazione nel TurismoWIAD16 - L'Architettura dell'Informazione nel Turismo
WIAD16 - L'Architettura dell'Informazione nel Turismo
Hoang Huynh
 
Workshop BSW15 - Where Innovation Comes From - Better Software 2015
Workshop BSW15 - Where Innovation Comes From - Better Software 2015Workshop BSW15 - Where Innovation Comes From - Better Software 2015
Workshop BSW15 - Where Innovation Comes From - Better Software 2015
Hoang Huynh
 
Codemotion Milan 2014 - B00bs, Kittens and Celebs
Codemotion Milan 2014 - B00bs, Kittens and CelebsCodemotion Milan 2014 - B00bs, Kittens and Celebs
Codemotion Milan 2014 - B00bs, Kittens and Celebs
Hoang Huynh
 
WAY.DO - Presentation Deck - Slideware
WAY.DO - Presentation Deck - SlidewareWAY.DO - Presentation Deck - Slideware
WAY.DO - Presentation Deck - Slideware
Hoang Huynh
 
Better Software 14 - Waterfall UX
Better Software 14 - Waterfall UXBetter Software 14 - Waterfall UX
Better Software 14 - Waterfall UX
Hoang Huynh
 
IDFBOLOGNA - Le Interviste utente
IDFBOLOGNA - Le Interviste utenteIDFBOLOGNA - Le Interviste utente
IDFBOLOGNA - Le Interviste utente
Hoang Huynh
 
You WRONG, You DIE #Codemotion 2014
You WRONG, You DIE #Codemotion 2014You WRONG, You DIE #Codemotion 2014
You WRONG, You DIE #Codemotion 2014
Hoang Huynh
 
Thank you for Coding #BSW13
Thank you for Coding #BSW13Thank you for Coding #BSW13
Thank you for Coding #BSW13
Hoang Huynh
 
Passare a Partita IVA, al PUGBO
Passare a Partita IVA, al PUGBOPassare a Partita IVA, al PUGBO
Passare a Partita IVA, al PUGBO
Hoang Huynh
 
It Shouldnt Work That Way
It Shouldnt Work That WayIt Shouldnt Work That Way
It Shouldnt Work That Way
Hoang Huynh
 

More from Hoang Huynh (19)

ITA - Preparare un Workshop con Playmobil.PRO®
ITA - Preparare un Workshop con Playmobil.PRO®ITA - Preparare un Workshop con Playmobil.PRO®
ITA - Preparare un Workshop con Playmobil.PRO®
 
ENG - How to Design a Workshop with Playmobil.PRO®
ENG - How to Design a Workshop with Playmobil.PRO®ENG - How to Design a Workshop with Playmobil.PRO®
ENG - How to Design a Workshop with Playmobil.PRO®
 
ITA - A Personas Primer
ITA - A Personas PrimerITA - A Personas Primer
ITA - A Personas Primer
 
Dont ask for my time - Feedback conversation starter
Dont ask for my time - Feedback conversation starterDont ask for my time - Feedback conversation starter
Dont ask for my time - Feedback conversation starter
 
The Welcome - New recruit welcome speech
The Welcome - New recruit welcome speechThe Welcome - New recruit welcome speech
The Welcome - New recruit welcome speech
 
TAG LateNight - Experience and Digital Transformation -
TAG LateNight - Experience and Digital Transformation - TAG LateNight - Experience and Digital Transformation -
TAG LateNight - Experience and Digital Transformation -
 
Riconoscere e Gestire il Debito UX - Agile Business Day 2016 #ABD16
Riconoscere e Gestire il Debito UX - Agile Business Day 2016 #ABD16Riconoscere e Gestire il Debito UX - Agile Business Day 2016 #ABD16
Riconoscere e Gestire il Debito UX - Agile Business Day 2016 #ABD16
 
Crafting Great Hypotheses - Droidcon 2016
Crafting Great Hypotheses - Droidcon 2016Crafting Great Hypotheses - Droidcon 2016
Crafting Great Hypotheses - Droidcon 2016
 
WIAD16 - L'Architettura dell'Informazione nel Turismo
WIAD16 - L'Architettura dell'Informazione nel TurismoWIAD16 - L'Architettura dell'Informazione nel Turismo
WIAD16 - L'Architettura dell'Informazione nel Turismo
 
Workshop BSW15 - Where Innovation Comes From - Better Software 2015
Workshop BSW15 - Where Innovation Comes From - Better Software 2015Workshop BSW15 - Where Innovation Comes From - Better Software 2015
Workshop BSW15 - Where Innovation Comes From - Better Software 2015
 
Codemotion Milan 2014 - B00bs, Kittens and Celebs
Codemotion Milan 2014 - B00bs, Kittens and CelebsCodemotion Milan 2014 - B00bs, Kittens and Celebs
Codemotion Milan 2014 - B00bs, Kittens and Celebs
 
WAY.DO - Presentation Deck - Slideware
WAY.DO - Presentation Deck - SlidewareWAY.DO - Presentation Deck - Slideware
WAY.DO - Presentation Deck - Slideware
 
Better Software 14 - Waterfall UX
Better Software 14 - Waterfall UXBetter Software 14 - Waterfall UX
Better Software 14 - Waterfall UX
 
IDFBOLOGNA - Le Interviste utente
IDFBOLOGNA - Le Interviste utenteIDFBOLOGNA - Le Interviste utente
IDFBOLOGNA - Le Interviste utente
 
You WRONG, You DIE #Codemotion 2014
You WRONG, You DIE #Codemotion 2014You WRONG, You DIE #Codemotion 2014
You WRONG, You DIE #Codemotion 2014
 
Thank you for Coding #BSW13
Thank you for Coding #BSW13Thank you for Coding #BSW13
Thank you for Coding #BSW13
 
About Me
About MeAbout Me
About Me
 
Passare a Partita IVA, al PUGBO
Passare a Partita IVA, al PUGBOPassare a Partita IVA, al PUGBO
Passare a Partita IVA, al PUGBO
 
It Shouldnt Work That Way
It Shouldnt Work That WayIt Shouldnt Work That Way
It Shouldnt Work That Way
 

Recently uploaded

GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 

Recently uploaded (20)

GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 

PechaKucha Less VS Sass

  • 1. 20013/04/17 20x20 Less VS Sass Mine is Longer... Hoang C. Huynh @aetheros mercoledì 17 aprile 13
  • 2. Less VS Sass 2 WE ALL STANDARDS mercoledì 17 aprile 13
  • 3. Less VS Sass 3 Historical Outcomes § Fragmentation § Inconsistency § Vendor Captivity § “Wish I Could” Syndrome § Variables § Object Oriented § Inheritance § Functions § Business Logic CSS’ TROUBLESOME YOUTH mercoledì 17 aprile 13
  • 4. Less VS Sass 4 http://lesscss.org/ http://sass-lang.com/ 2009 - Alexis Sellier 2007 - Hampton Catlin § These are not frameworks nor toolkits. § These are preprocessors, that try to fill the gaps present in the standard CSS development What we are talking about? Code Less, Code Better mercoledì 17 aprile 13
  • 5. FIrst Thing FIrst 5 WHY PREPROCESS? § Error Detection Misplaced {}, missing commas, misspelled attributes or inconsistent values § Code Minification Compact of Selector and shorthand values, comments and spaces discard § Code Organization Physical inclusion of files, namespacing, folder organization § Customization mercoledì 17 aprile 13
  • 6. FIrst Thing FIrst 6 WHY PREPROCESS? § Write less code and follow DRY principles § Write maintainable code and, hopefully, more readable ( ...it’s not easy to get both... ) § Juggle complexity and bounce it back to who’s “able” to handle it § Power and Flexibility mercoledì 17 aprile 13
  • 7. Less VS Sass 7 § Mixins: LESS Elements, Less Mixins § Mixins: GroundworkCSS, Bourbon § Layout: 960, Frameless, Semantic, § Grids: Neat, Gridset, Zen Grids Less Framework, Even.less, Centage § ... § ... § Killer Framework: Compass § Killer App: Twitter Bootstrap § Killer App: Foundation ECOSYSTEM DIFFERENCE mercoledì 17 aprile 13
  • 8. Less VS Sass 8 “It’s just CSS” “It’s more than CSS” § Declarative style of coding § Imperative style of coding § CSS Friendly Syntax § Compiler Directive § Declare what you want to see § Declare how you want things to be done PHILOSOPHICAL DIFFERENCE mercoledì 17 aprile 13
  • 9. Less VS Sass 9 Oldies but Goodies § SASS is part of the Ruby family gem install sass mv style.css style.scss § Ruby comes with MacOSX sass --watch style.scss:style.css § SASS has two syntaxes: SCSS & the former SASS $main_color: #FF03DE; $main_color: #FF03DE .content-navigation { .content-navigation border-color: $main_color; border-color: $main_color } No handles, no commas, indentation based mercoledì 17 aprile 13
  • 10. Less VS Sass 10 WHY AM I SO POPULAR? § LESS is part of the Javascript family npm install -g less § To compile, Node.JS is required and lessc -x styles.less > styles.css the package is available through NPN § LESS compilers comes in many flavors, even PHP doh! § LESS can run directly on the client browser! <link  rel="stylesheet/less"  type="text/css"  href="styles.less"> <script  src="less.js"  type="text/javascript"></script> ...WHICH IS THE WORST, but Designers seem to like it... mercoledì 17 aprile 13
  • 11. Less VS Sass 11 WHY AM I SO POPULAR? § LESS is young and is catching up with SASS very fast, fueled by the rapid growth of Node.JS and Bootstrap § The LESS universe is lagging behind a lack of syntactic polishness and fragmentation of modules, add ons and forks, but that it is not definitely a bad thing. § Documentation is more noob friendly mercoledì 17 aprile 13
  • 12. Less VS Sass 12 Variables @nice-blue: #5B83AD; $nice-blue: #5B83AD; @light-blue: (@nice-blue + #111); $light-blue: ($nice-blue + #111); #header { color: @light-blue; } #header { color: $light-blue; } #header { color: #6c94be; } Winner: TIE mercoledì 17 aprile 13
  • 13. Less VS Sass 13 Nesting table.hl { table.hl { margin: 2em 0; margin: 2em 0; “&” is the &:hover { &:hover { parent selector text-align: right; text-align: right; } } li { li { font: { font-family: serif; family: serif; font-weight: bold; weight: bold; } } } } } table.hl { table.hl li { margin: 2em 0; font-family: serif; } font-weight: bold; table.hl:hover { font-size: 1.2em; text-align: right; } Winner: SASS } mercoledì 17 aprile 13
  • 14. Less VS Sass 14 Mixins .bordered(@pix: 2px) { @mixin bordered($pix: 2px) { border-top: dotted 1px black; border-top: dotted 1px black; border-bottom: solid @pix black; border-bottom: solid $pix black; } } #menu a { #menu a { .bordered(); @include bordered(); } } .post a { .post a { .bordered(4px); @include bordered(4px); } } #menu a { .post a { border-top: dotted 2px black; border-top: dotted 2px black; border-bottom: solid 4px black; border-bottom: solid 4px black; } } Winner: TIE mercoledì 17 aprile 13
  • 15. Less VS Sass 15 Inheritance .module-a { .module-a { color: #123456; color: #123456; } } .module-b {{ .module-b { .module-a(); @extend .module-a; border: 1px solid red; border: 1px solid red; } } LESS 1.4 will support the Extend directive in the same way that SASS do, but as a pseudoclass .module-a { .module-a, .module-b { color: #123456; color: #123456; } } .module-b { .module-b { color: #123456; border: 1px solid red; border: 1px solid red; } Winner: SASS (for now) } mercoledì 17 aprile 13
  • 16. Less VS Sass 16 Advanced Logic § GUARDED MIXINS § IF ELSE .mixin(params) when (dir=top){ @mixin my-mixin($parameters){ /* Conditional stuff */ @if $my-parameter == value { } /* Conditional stuff */ } } § RECURSION § LOOPS .loop(@index) when (@index &gt; 0) { @for $i from 1 through 10 { (~".my-element:nth-child(@{index})") { animation-name: "load-@{index}"; /* My stuff here */ } } .loop(@index - 1); } .loop (0) {} § CONCATENATION @nbElements: 10; #{$my-selector} { .loop (@nbElements); #{$my-property}: $my-value; § NO CONCATENATION } Winner: SASS mercoledì 17 aprile 13
  • 17. In the End 17 SO? WHICH ONE SHOULD WE PICK? DOES IT REALLY MATTER? § In a couple of month both preprocessors will be 90% similar § Know your Client and your project, simply pick the one that suits better for thy mercoledì 17 aprile 13
  • 18. In the End 18 GRAVE DANGER YOU ARE IN, IMPATIENT YOU ARE § Learn / Master CSS first, You must § To think re-usable, You have § Build Components not Views You will § K.I.S.S! Presentation not logic CSS is! § Nice SASS / LESS sources can compile in ugly code! #dettaglioIniziative #content .vscroller .days li .month .list .activity .hour { font-weight: 700; line-height: 50px; font-size: 18px; float: left; } mercoledì 17 aprile 13
  • 19. In the End 19 FInal Takeaway For the most of the average designer / developer, the general knowledge of a preprocessor should really suffice, so in the end is just a matter of preferences. Don’t get cocky and pick the right tool! Don’t forget to check sometimes the new hero in town, he may really surprise you :) border-radius() -webkit-border-radius arguments -moz-border-radius arguments border-radius arguments body font 12px Helvetica, Arial, sans-serif a.button border-radius 5px mercoledì 17 aprile 13
  • 20. Question Time 20 Question Time! ...We will be using Boostrap+Sass... mercoledì 17 aprile 13