SlideShare a Scribd company logo
Introduction to
Less / Sass / Compass

Presented by
Chris Lee
@levelten_chris
Prerequisites

                ● Strong understanding of
                  CSS
                ● Familiarity with control
                  structures, functions,
                  variables
                ● Lazy Desire to
                  be more Efficient
                ● Familiarity CSS3
                ● Interest in Theming
What's in it for me?
... Goals
● Understanding of High Level Purpose of
  Preprocessing languages

● Learn how to get started

● How this works with Drupal...

  Yes, there's a module for that!
CSS




Less / Sass /
Compass
Why should i use less/sass?
● Web is complex.
  No longer simple.

● Front End Performance

● DRY principle

● Frameworks / OOCSS

● Cross-Browser
  Compatibility

● It's easy!
Gaining Front End Performance
● Reduce HTTP Number of Requests

● Reduce, reuse, and recycle css

● Compress assets
Demonstration: Variables
Create a variable file using sass

open "demo1"
Getting started Less / Sass

1. There's a module for it.

2. CLI: node.js / ruby gems

3. Client Side GUI's

Any other methods? Let us all know!
Method 1: Drupal Modules
● Less http://drupal.org/project/less
● Prepro http://drupal.org/project/prepro
● Sassy http://drupal.org/project/sassy


Others
● Live CSS http://drupal.org/project/live_css
● Sass http://drupal.org/project/sass
Method 2: Command Line
Processors

● Node js
  $ npm install less
  $ sudo apt-get install node-less

● ruby gem

  $ gem install sass
  $ gem install compass
Method 3: Client Side GUIs
SimpLess
Mac / Win
http:
//wearekiss.
com/simpless
Method 3: Client Side GUIs
Scout (mac)
http://mhs.
github.
com/scout-app/
Method 3: Client Side GUIs
Compass.app
Mac / win /
linux
http://compass.
handlino.com/
How does one pick a preprocessor?
● Get Excited! Dive in.

● Figure out workflow
Syntax
Differences between Less / Sass?
● Very little differences

● Small syntax issues

● Workflow

● Frameworks / Library advantages
Introductory
Preprocessor Concepts
●   Nested
●   Mixins
●   Control Structures
●   Importing
Same Syntax: Less / Sass / Compass
● Nested Structures

// less                   // sass / scss
// @file style.less.css   // @file style.scss
body {                    body {
  .header {                 .header {
     background: #fc0;         background: #fc0;
   }                         }
}                         }
Same Syntax: Less / Sass / Compass
● Importing files


// less                   // sass or scss
// @file style.less.css   // @file style.scss

@import "file";           @import "foo";
@import 'file.less';      @import "foo.scss";
@import http://foo.       @import "http://foo.com/foo;
com/foo;                  @import url(foo);
@import url(file);
Mixin
"Mixins allow you to define styles that can be
re-used throughout the stylesheet without
needing to resort to non-semantic classes like .
float-left. Mixins can also contain full CSS rules,
and anything else allowed elsewhere in a Sass
document. They can even take arguments
which allows you to produce a wide variety of
styles with very few mixins."

- Sass-Lang.com
Mixin




        TLDR;
Mixin
// Less                         // Sass
.border-radius(@r:0px) {        @mixin border-radius($r:0px) {
   -moz-border-radius: @r;        -moz-border-radius: $r;
   -o-border-radius: @r;          -o-border-radius: $r;
   -khtml-border-radius:@r;       -khtml-border-radius:$r;
    -webkit-border-radius:@r;     -webkit-border-radius:$r;
    border-radius: @r;            border-radius: $r;
}                               }
Mixin
// Less                          // Sass
.border-radius(@r:0px) {         @mixin border-radius($r:0px) {
   -moz-border-radius: @r;         -moz-border-radius: $r;
   -o-border-radius: @r;           -o-border-radius: $r;
   -khtml-border-radius:@r;        -khtml-border-radius:$r;
    -webkit-border-radius:@r;      -webkit-border-radius:$r;
    border-radius: @r;             border-radius: $r;
}                                }

// "Invoke" the mixin            // Invoke the mixin
.myDiv {                         .myDiv {
      .border-radius(2px+2px);      @include border-radius
}                                (2px+2px);
                                 }
Mixin: CSS Output
.myDiv {
  -moz-border-radius: 4px;
  -o-border-radius: 4px;
  -khtml-border-radius: 4px;
   -webkit-border-radius:4px;
   border-radius: 4px;
}
WHAT IT ADDS?!@!
2px + 2px = 4px
Lighten / Darkens
// less
lightness (@color, 10%);
darkness (@color, 10%);

// scss
@include lighten($color, 10%);
@include darken($color, 10%);
Sass project files



Random Live Demonstration Time...

- Demo2 - What is a project file
- Demo3 - Creating a project with compass
Frameworks
Less Frameworks
● Bootstrap
  http://twitter.github.com/bootstrap/
● Centage
  http://centage.peruste.net/
Sass Frameworks
● Compass - http://compass-style.org/
● Bourbon - http://thoughtbot.com/bourbon/
● Foundation - https://github.
  com/zurb/foundation
What is compass?
● sass mixin library
● sass meta framework
● reduce low level tasks

How do i install this?

● Install with a rubygem
  $ gem install compass
Compass Example: Opacity

 @import "compass/css3/opacity"

 div.box {
   $opacity: .9;
   opacity($opacity);
 }
Compass Example: Opacity
div.box {
  filter: progid:DXImageTransform.Microsoft.
Alpha(Opacity=90);
  opacity: 0.9;
}
Compass Example: url helpers
div.box {
  background: image-url('lolcat-bg.jpg');
}
Compass Example: url helpers
div.box {
   background: 'sites/all/themes/foo/images
   /lolcat-bg.jpg?4324343';
}
Learn more
Less
● http://lesscss.org/
● http://leafo.net/lessphp/docs/
Sass
● http://sass-lang.com/
● http://sass-lang.com/docs/yardoc/file.
  SASS_REFERENCE.html
Compass
● http://compass-style.org/
Questions?
Questions?

Arial 48pt. Google
   Powerpoint
Questions?
Thanks!

       Slides:
http://goo.gl/71wK5

More Related Content

What's hot

LESS CSS
LESS CSSLESS CSS
LESS CSS
Man Math
 
LESS CSS
LESS CSSLESS CSS
Sass installation
Sass installationSass installation
Sass installation
Vinita Swamy
 
Make your CSS beautiful again
Make your CSS beautiful againMake your CSS beautiful again
Make your CSS beautiful again
spannerspace Hales
 
Sass - basic to advance
Sass  - basic to advanceSass  - basic to advance
Sass - basic to advance
Vinita Swamy
 
Compass n Sass
Compass n SassCompass n Sass
Compass n Sass
Pradeep Saraswathi
 
SASS Preprocessor
SASS PreprocessorSASS Preprocessor
SASS Preprocessor
Webkul Software Pvt. Ltd.
 
Sass presentation
Sass presentationSass presentation
Sass presentation
Davin Abraham
 
Sass in 5
Sass in 5Sass in 5
Sass in 5
Mario Peshev
 
The way to be a developer "What I Need"
The way to be a developer "What I Need"The way to be a developer "What I Need"
The way to be a developer "What I Need"
egyappassiut
 
Twitter Bootstrap Presentation
Twitter Bootstrap PresentationTwitter Bootstrap Presentation
Twitter Bootstrap PresentationDuy Do Phan
 
Dangerous CSS
Dangerous CSSDangerous CSS
Dangerous CSS
Mike Wilcox
 
LESS is More
LESS is MoreLESS is More
LESS is More
Nathan Lawrence
 
remodel your persistence layer
remodel your persistence layerremodel your persistence layer
remodel your persistence layer
Tim Lossen
 
Webpack: What it is, What it does, Whether you need it
Webpack: What it is, What it does, Whether you need itWebpack: What it is, What it does, Whether you need it
Webpack: What it is, What it does, Whether you need it
Mike Wilcox
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
iradarji
 
Rubyonrails 090715105949-phpapp01
Rubyonrails 090715105949-phpapp01Rubyonrails 090715105949-phpapp01
Rubyonrails 090715105949-phpapp01sagaroceanic11
 
CSS3 for web designer - How to design a visually appealing website
CSS3 for web designer - How to design a visually appealing websiteCSS3 for web designer - How to design a visually appealing website
CSS3 for web designer - How to design a visually appealing website
Mario Hernandez
 

What's hot (20)

LESS CSS
LESS CSSLESS CSS
LESS CSS
 
LESS CSS
LESS CSSLESS CSS
LESS CSS
 
Sass installation
Sass installationSass installation
Sass installation
 
Make your CSS beautiful again
Make your CSS beautiful againMake your CSS beautiful again
Make your CSS beautiful again
 
Sass - basic to advance
Sass  - basic to advanceSass  - basic to advance
Sass - basic to advance
 
Compass n Sass
Compass n SassCompass n Sass
Compass n Sass
 
SASS Preprocessor
SASS PreprocessorSASS Preprocessor
SASS Preprocessor
 
Sass presentation
Sass presentationSass presentation
Sass presentation
 
Beautifying senc
Beautifying sencBeautifying senc
Beautifying senc
 
Efficient theming in Drupal
Efficient theming in DrupalEfficient theming in Drupal
Efficient theming in Drupal
 
Sass in 5
Sass in 5Sass in 5
Sass in 5
 
The way to be a developer "What I Need"
The way to be a developer "What I Need"The way to be a developer "What I Need"
The way to be a developer "What I Need"
 
Twitter Bootstrap Presentation
Twitter Bootstrap PresentationTwitter Bootstrap Presentation
Twitter Bootstrap Presentation
 
Dangerous CSS
Dangerous CSSDangerous CSS
Dangerous CSS
 
LESS is More
LESS is MoreLESS is More
LESS is More
 
remodel your persistence layer
remodel your persistence layerremodel your persistence layer
remodel your persistence layer
 
Webpack: What it is, What it does, Whether you need it
Webpack: What it is, What it does, Whether you need itWebpack: What it is, What it does, Whether you need it
Webpack: What it is, What it does, Whether you need it
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
Rubyonrails 090715105949-phpapp01
Rubyonrails 090715105949-phpapp01Rubyonrails 090715105949-phpapp01
Rubyonrails 090715105949-phpapp01
 
CSS3 for web designer - How to design a visually appealing website
CSS3 for web designer - How to design a visually appealing websiteCSS3 for web designer - How to design a visually appealing website
CSS3 for web designer - How to design a visually appealing website
 

Viewers also liked

支付宝WAP站点收银台适配ios &android
支付宝WAP站点收银台适配ios &android支付宝WAP站点收银台适配ios &android
支付宝WAP站点收银台适配ios &android
Zhu Qi
 
用户体验组设计流程
用户体验组设计流程用户体验组设计流程
用户体验组设计流程Zhu Qi
 
SASS 让你更爽的 编写CSS
SASS 让你更爽的 编写CSS SASS 让你更爽的 编写CSS
SASS 让你更爽的 编写CSS
Zhu Qi
 
Web app share
Web app shareWeb app share
Web app share
Zhu Qi
 
Understand prototype
Understand prototypeUnderstand prototype
Understand prototype
Zhu Qi
 
More with LeSS - An Introduction to Large Scale Scrum by Tim Abbott
More with LeSS - An Introduction to Large Scale Scrum by Tim AbbottMore with LeSS - An Introduction to Large Scale Scrum by Tim Abbott
More with LeSS - An Introduction to Large Scale Scrum by Tim Abbott
Agile ME
 
Introduction to LESS
Introduction to LESSIntroduction to LESS
Introduction to LESS
Manish Shekhawat
 
Why Large Scale Scrum (LeSS)?
Why Large Scale Scrum (LeSS)?Why Large Scale Scrum (LeSS)?
Why Large Scale Scrum (LeSS)?
AdventuresWithAgile
 
Thiga - Notre retour d'expérience sur le Design sprint
Thiga - Notre retour d'expérience sur le Design sprintThiga - Notre retour d'expérience sur le Design sprint
Thiga - Notre retour d'expérience sur le Design sprint
Thiga
 

Viewers also liked (9)

支付宝WAP站点收银台适配ios &android
支付宝WAP站点收银台适配ios &android支付宝WAP站点收银台适配ios &android
支付宝WAP站点收银台适配ios &android
 
用户体验组设计流程
用户体验组设计流程用户体验组设计流程
用户体验组设计流程
 
SASS 让你更爽的 编写CSS
SASS 让你更爽的 编写CSS SASS 让你更爽的 编写CSS
SASS 让你更爽的 编写CSS
 
Web app share
Web app shareWeb app share
Web app share
 
Understand prototype
Understand prototypeUnderstand prototype
Understand prototype
 
More with LeSS - An Introduction to Large Scale Scrum by Tim Abbott
More with LeSS - An Introduction to Large Scale Scrum by Tim AbbottMore with LeSS - An Introduction to Large Scale Scrum by Tim Abbott
More with LeSS - An Introduction to Large Scale Scrum by Tim Abbott
 
Introduction to LESS
Introduction to LESSIntroduction to LESS
Introduction to LESS
 
Why Large Scale Scrum (LeSS)?
Why Large Scale Scrum (LeSS)?Why Large Scale Scrum (LeSS)?
Why Large Scale Scrum (LeSS)?
 
Thiga - Notre retour d'expérience sur le Design sprint
Thiga - Notre retour d'expérience sur le Design sprintThiga - Notre retour d'expérience sur le Design sprint
Thiga - Notre retour d'expérience sur le Design sprint
 

Similar to Dallas Drupal Days 2012 - Introduction to less sass-compass

Elegant CSS Design In Drupal: LESS vs Sass
Elegant CSS Design In Drupal: LESS vs SassElegant CSS Design In Drupal: LESS vs Sass
Elegant CSS Design In Drupal: LESS vs SassMediacurrent
 
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and CompassBringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
Claudina Sarahe
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, Greensock
Marco Pinheiro
 
UNIT 3.ppt
UNIT 3.pptUNIT 3.ppt
UNIT 3.ppt
kavi806657
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentation
Mario Noble
 
LESS : The dynamic stylesheet language
LESS : The dynamic stylesheet languageLESS : The dynamic stylesheet language
LESS : The dynamic stylesheet language
Katsunori Tanaka
 
SASS is more than LESS
SASS is more than LESSSASS is more than LESS
SASS is more than LESSItai Koren
 
CSS előfeldolgozók
CSS előfeldolgozókCSS előfeldolgozók
CSS előfeldolgozók
Máté Farkas
 
CSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y tryingCSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y trying
James Cryer
 
Simple introduction Sass
Simple introduction SassSimple introduction Sass
Simple introduction SassZeeshan Ahmed
 
SASS for WordPress Workshop
SASS for WordPress WorkshopSASS for WordPress Workshop
SASS for WordPress Workshop
Kanchha kaji Prajapati
 
Introducing grunt, npm and sass
Introducing grunt, npm and sassIntroducing grunt, npm and sass
Introducing grunt, npm and sass
priyanka1452
 
Deep dive into sass
Deep dive into sassDeep dive into sass
Deep dive into sass
Knoldus Inc.
 
Advanced Technology for Web Application Design
Advanced Technology for Web Application DesignAdvanced Technology for Web Application Design
Advanced Technology for Web Application DesignBryce Kerley
 
Doing more with LESS
Doing more with LESSDoing more with LESS
Doing more with LESS
jsmith92
 
Fasten RWD Development with Sass
Fasten RWD Development with SassFasten RWD Development with Sass
Fasten RWD Development with Sass
Sven Wolfermann
 
Do more with {less}
Do more with {less}Do more with {less}
Do more with {less}
Jesper Wøldiche
 

Similar to Dallas Drupal Days 2012 - Introduction to less sass-compass (20)

Elegant CSS Design In Drupal: LESS vs Sass
Elegant CSS Design In Drupal: LESS vs SassElegant CSS Design In Drupal: LESS vs Sass
Elegant CSS Design In Drupal: LESS vs Sass
 
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and CompassBringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, Greensock
 
UNIT 3.ppt
UNIT 3.pptUNIT 3.ppt
UNIT 3.ppt
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentation
 
LESS : The dynamic stylesheet language
LESS : The dynamic stylesheet languageLESS : The dynamic stylesheet language
LESS : The dynamic stylesheet language
 
SASS is more than LESS
SASS is more than LESSSASS is more than LESS
SASS is more than LESS
 
CSS előfeldolgozók
CSS előfeldolgozókCSS előfeldolgozók
CSS előfeldolgozók
 
CSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y tryingCSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y trying
 
CSS3
CSS3CSS3
CSS3
 
Simple introduction Sass
Simple introduction SassSimple introduction Sass
Simple introduction Sass
 
Big Frontends Made Simple
Big Frontends Made SimpleBig Frontends Made Simple
Big Frontends Made Simple
 
SASS for WordPress Workshop
SASS for WordPress WorkshopSASS for WordPress Workshop
SASS for WordPress Workshop
 
Why less?
Why less?Why less?
Why less?
 
Introducing grunt, npm and sass
Introducing grunt, npm and sassIntroducing grunt, npm and sass
Introducing grunt, npm and sass
 
Deep dive into sass
Deep dive into sassDeep dive into sass
Deep dive into sass
 
Advanced Technology for Web Application Design
Advanced Technology for Web Application DesignAdvanced Technology for Web Application Design
Advanced Technology for Web Application Design
 
Doing more with LESS
Doing more with LESSDoing more with LESS
Doing more with LESS
 
Fasten RWD Development with Sass
Fasten RWD Development with SassFasten RWD Development with Sass
Fasten RWD Development with Sass
 
Do more with {less}
Do more with {less}Do more with {less}
Do more with {less}
 

Recently uploaded

Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
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
 
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
 
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
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
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
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
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
 
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
 
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
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
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
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 

Recently uploaded (20)

Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
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
 
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
 
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
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
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
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
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
 
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...
 
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
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
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...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 

Dallas Drupal Days 2012 - Introduction to less sass-compass

  • 1. Introduction to Less / Sass / Compass Presented by Chris Lee @levelten_chris
  • 2. Prerequisites ● Strong understanding of CSS ● Familiarity with control structures, functions, variables ● Lazy Desire to be more Efficient ● Familiarity CSS3 ● Interest in Theming
  • 3. What's in it for me? ... Goals ● Understanding of High Level Purpose of Preprocessing languages ● Learn how to get started ● How this works with Drupal... Yes, there's a module for that!
  • 4. CSS Less / Sass / Compass
  • 5. Why should i use less/sass? ● Web is complex. No longer simple. ● Front End Performance ● DRY principle ● Frameworks / OOCSS ● Cross-Browser Compatibility ● It's easy!
  • 6. Gaining Front End Performance ● Reduce HTTP Number of Requests ● Reduce, reuse, and recycle css ● Compress assets
  • 7. Demonstration: Variables Create a variable file using sass open "demo1"
  • 8. Getting started Less / Sass 1. There's a module for it. 2. CLI: node.js / ruby gems 3. Client Side GUI's Any other methods? Let us all know!
  • 9. Method 1: Drupal Modules ● Less http://drupal.org/project/less ● Prepro http://drupal.org/project/prepro ● Sassy http://drupal.org/project/sassy Others ● Live CSS http://drupal.org/project/live_css ● Sass http://drupal.org/project/sass
  • 10. Method 2: Command Line Processors ● Node js $ npm install less $ sudo apt-get install node-less ● ruby gem $ gem install sass $ gem install compass
  • 11. Method 3: Client Side GUIs SimpLess Mac / Win http: //wearekiss. com/simpless
  • 12. Method 3: Client Side GUIs Scout (mac) http://mhs. github. com/scout-app/
  • 13. Method 3: Client Side GUIs Compass.app Mac / win / linux http://compass. handlino.com/
  • 14. How does one pick a preprocessor? ● Get Excited! Dive in. ● Figure out workflow
  • 16. Differences between Less / Sass? ● Very little differences ● Small syntax issues ● Workflow ● Frameworks / Library advantages
  • 17. Introductory Preprocessor Concepts ● Nested ● Mixins ● Control Structures ● Importing
  • 18. Same Syntax: Less / Sass / Compass ● Nested Structures // less // sass / scss // @file style.less.css // @file style.scss body { body { .header { .header { background: #fc0; background: #fc0; } } } }
  • 19. Same Syntax: Less / Sass / Compass ● Importing files // less // sass or scss // @file style.less.css // @file style.scss @import "file"; @import "foo"; @import 'file.less'; @import "foo.scss"; @import http://foo. @import "http://foo.com/foo; com/foo; @import url(foo); @import url(file);
  • 20. Mixin "Mixins allow you to define styles that can be re-used throughout the stylesheet without needing to resort to non-semantic classes like . float-left. Mixins can also contain full CSS rules, and anything else allowed elsewhere in a Sass document. They can even take arguments which allows you to produce a wide variety of styles with very few mixins." - Sass-Lang.com
  • 21. Mixin TLDR;
  • 22. Mixin // Less // Sass .border-radius(@r:0px) { @mixin border-radius($r:0px) { -moz-border-radius: @r; -moz-border-radius: $r; -o-border-radius: @r; -o-border-radius: $r; -khtml-border-radius:@r; -khtml-border-radius:$r; -webkit-border-radius:@r; -webkit-border-radius:$r; border-radius: @r; border-radius: $r; } }
  • 23. Mixin // Less // Sass .border-radius(@r:0px) { @mixin border-radius($r:0px) { -moz-border-radius: @r; -moz-border-radius: $r; -o-border-radius: @r; -o-border-radius: $r; -khtml-border-radius:@r; -khtml-border-radius:$r; -webkit-border-radius:@r; -webkit-border-radius:$r; border-radius: @r; border-radius: $r; } } // "Invoke" the mixin // Invoke the mixin .myDiv { .myDiv { .border-radius(2px+2px); @include border-radius } (2px+2px); }
  • 24. Mixin: CSS Output .myDiv { -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; -webkit-border-radius:4px; border-radius: 4px; }
  • 26. 2px + 2px = 4px
  • 27. Lighten / Darkens // less lightness (@color, 10%); darkness (@color, 10%); // scss @include lighten($color, 10%); @include darken($color, 10%);
  • 28. Sass project files Random Live Demonstration Time... - Demo2 - What is a project file - Demo3 - Creating a project with compass
  • 30. Less Frameworks ● Bootstrap http://twitter.github.com/bootstrap/ ● Centage http://centage.peruste.net/
  • 31. Sass Frameworks ● Compass - http://compass-style.org/ ● Bourbon - http://thoughtbot.com/bourbon/ ● Foundation - https://github. com/zurb/foundation
  • 32. What is compass? ● sass mixin library ● sass meta framework ● reduce low level tasks How do i install this? ● Install with a rubygem $ gem install compass
  • 33. Compass Example: Opacity @import "compass/css3/opacity" div.box { $opacity: .9; opacity($opacity); }
  • 34. Compass Example: Opacity div.box { filter: progid:DXImageTransform.Microsoft. Alpha(Opacity=90); opacity: 0.9; }
  • 35. Compass Example: url helpers div.box { background: image-url('lolcat-bg.jpg'); }
  • 36. Compass Example: url helpers div.box { background: 'sites/all/themes/foo/images /lolcat-bg.jpg?4324343'; }
  • 37. Learn more Less ● http://lesscss.org/ ● http://leafo.net/lessphp/docs/ Sass ● http://sass-lang.com/ ● http://sass-lang.com/docs/yardoc/file. SASS_REFERENCE.html Compass ● http://compass-style.org/
  • 41. Thanks! Slides: http://goo.gl/71wK5