SlideShare una empresa de Scribd logo
1 de 31
Sass/Compass
HTML5/CSS3 Rapid Prototyping Tools
Who is this guy?


                      Nick Cooley
     Principal Front-End Architect,
                     TandemSeven:
             http://www.tandemseven.com


            @nickcooley
Why Use a CSS
     Framework?
• Instead of repetitively implementing
  patterns and values, you can
  modularize your CSS.

• CSS is limited and difficult to extend
  by itself.

• When prototyping, shouldn’t you
  focus more on the, you know,
  prototyping?
DRY
DRY
• “Don’t Repeat Yourself”
• Fundamental best practice of CSS
  frameworks
Sass
• What is Sass?
• Nesting
• Vars
• Mixins
Compass
• Save Time!
• X-Browser CSS3 mixins
• Provides Common CSS development
 Patterns in an easy-to-use-format
Let’s Talk About
      Sass
What is Sass?
• Stands for “Syntactically Awesome
  StyleSheets”

• “Sass both provides a simpler, more
  elegant syntax for CSS and
  implements various features that
  are useful for creating manageable
  stylesheets.”

• Ruby Based
Sass: Nesting
Sass: Nesting
• CSS: in order to contextually apply
  selectors, you might need to repeat
  selectors.

• This can be Repetitive,   potentially
  messy and confusing
Sass: Nesting
•Sass: Allows you to
 nest selectors
 within a parent
 selector.

•This provides an
 approach that’s
 clean, concise,
 unique and DRY
Sass: Variables
Sass: Variables
• Allow you to quickly parameterize
  your CSS

• Create diverse variations in
  seconds!

• Helps you create design standards
  for your CSS.

• Using a main color in a number of
Sass: Variables
• Imagine you are using a color as a
  theme throughout your CSS.




• Imagine the $color1 variable spread
  all over your CSS? How easy to
Sass: Mixins
Sass: Mixins
• Mixins:Sass :: Functions:Javascript
• Allow you to define patterns for
  reuse

• Mixins can be imported across
  projects, helping you to create your
  own framework
Sass: Mixins
• Imagine the following case: You
  have a standard button theme you
  use across your site. It has:

 • Rounded Corners
 • Gradients
 • Drop Shadows (multiple)
• What would the CSS for such a
  button look like?
Sass: Mixins
div[role="main"] li button {
  border: 1px solid #d8dee7;
  background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #d8dee7));
  background-image: -webkit-linear-gradient(#ffffff, #d8dee7);
  background-image: -moz-linear-gradient(#ffffff, #d8dee7);
  background-image: -o-linear-gradient(#ffffff, #d8dee7);
  background-image: -ms-linear-gradient(#ffffff, #d8dee7);
  background-image: linear-gradient(#ffffff, #d8dee7);
  padding: 3px 14px;
  font-size: 12px;
  color: #3b557d;
  -webkit-border-radius: 20px 20px;
  -moz-border-radius: 20px / 20px;
  -o-border-radius: 20px / 20px;
  -ms-border-radius: 20px / 20px;
  -khtml-border-radius: 20px / 20px;
  border-radius: 20px / 20px;
  cursor: pointer;
}

div[role="main"] li button.primary {
  border: 2px solid #3b557d;
  padding: 5px 15px;
  -webkit-border-radius: 22px 22px;
  -moz-border-radius: 22px / 22px;
  -o-border-radius: 22px / 22px;
  -ms-border-radius: 22px / 22px;
  -khtml-border-radius: 22px / 22px;
  border-radius: 22px / 22px;
}

div[role="main"] li button.disabled {
  opacity: .8;
}

div[role="main"] li   button:hover {
  background-image:   -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #d8dee7), color-stop(100%, #ffffff));
  background-image:   -webkit-linear-gradient(#d8dee7, #ffffff);
  background-image:   -moz-linear-gradient(#d8dee7, #ffffff);
  background-image:   -o-linear-gradient(#d8dee7, #ffffff);
  background-image:   -ms-linear-gradient(#d8dee7, #ffffff);
  background-image:   linear-gradient(#d8dee7, #ffffff);
}
Compass
What is Compass?
• “...open-source CSS authoring
  framework which uses the Sass
  stylesheet language to make writing
  stylesheets powerful and easy.”

• Provides a number of community-
  created mixins and modules to help
  integrate some of the most popular
  design patterns on the web.
Compass
• X-Browser CSS3 mixins
 • Rounded Corners        • Box Shadow
 • Gradients              • Text Shadow
• Common CSS development Patterns
 • Reset.css              • Sprites
 • Clearfix                • Web Fonts
 • CSS3 Pie               • More!
Compass
button {
  border:1px solid #acbed3;
  @include background-image(linear-gradient(#fff, #d8dee7));
  padding:3px 14px;
  font-size:12px;
  color:#3b557d;
  @include border-radius(7px, 7px);
  cursor:pointer;
  &.primary { border:2px solid #3b557d;
               padding:5px 15px;
               @include border-radius(9px, 9px);
               }
  &.disabled {
    opacity: .8;
  }
  &:hover {
    @include background-image(linear-gradient(#d8dee7, #fff));
  }
}
Compass
button {
  border:1px solid #acbed3;
    @include background-image(linear-gradient(#fff, #d8dee7));
    padding:3px 14px;
    font-size:12px;
    color:#3b557d;
    @include border-radius(7px, 7px);
    cursor:pointer;
    &.primary { border:2px solid #3b557d;
                 padding:5px 15px;
          @include border-radius($border-radius+2, $border-radius+2); }
    &.disabled {
      opacity: .8;
    }
    &:hover {
        @include background-image(linear-gradient(#d8dee7, #fff));
    }
}
Compass
•   Instead of:
    background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #d8dee7));
      background-image: -webkit-linear-gradient(#ffffff, #d8dee7);
      background-image: -moz-linear-gradient(#ffffff, #d8dee7);
      background-image: -o-linear-gradient(#ffffff, #d8dee7);
      background-image: -ms-linear-gradient(#ffffff, #d8dee7);
      background-image: linear-gradient(#ffffff, #d8dee7);




•   Compass Provides a mixin for gradients:
     @include background-image(linear-gradient(#d8dee7, #fff));




•   Instead of:
    -webkit-border-radius: 20px 20px;
    -moz-border-radius: 20px / 20px;
    -o-border-radius: 20px / 20px;
    -ms-border-radius: 20px / 20px;
    -khtml-border-radius: 20px / 20px;
    border-radius: 20px / 20px;




•   Compass Provides a mixin for border-radius:
    @include border-radius(20px, 20px);
How do I use?
• Both Sass and Compass are ruby-
  based applications.

• Most users use the terminal to run
  their instances

• If you don’t want to install Ruby or
  hate command line...
Compass.app
• Java Based
• Available for Windows/Mac/Linux
• A number of extensions: HTML5
  Boilerplate, Blueprint, 960, and
  more!

• No command line!
Demo
Links
•   Sample files: https://gist.github.com/1432176
•   Sass Site: http://www.sass-lang.com
•   Compass Site: http://compass-style.org
•   Compass.app Site:
    http://compass.handlino.com/
•   Manning Sass Book:
    http://www.manning.com/netherland/

•   https://addons.mozilla.org/en-US/firefox/addon/
    firesass-for-firebug/
Thank You!
• Twitter: @nickcooley
• Email: nick@homecooley.com
• LinkedIn: http://www.linkedin.com/in/
  ncooley
Questions?

Más contenido relacionado

La actualidad más candente

Introduction to SASS
Introduction to SASSIntroduction to SASS
Introduction to SASSJon Dean
 
From PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeFrom PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeDerek Christensen
 
Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)emrox
 
Authoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & SassAuthoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & Sasschriseppstein
 
Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)elliando dias
 
An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)Folio3 Software
 
Web Design Trends 2010 - What Is CSS3 All About?
Web Design Trends 2010 - What Is CSS3 All About?Web Design Trends 2010 - What Is CSS3 All About?
Web Design Trends 2010 - What Is CSS3 All About?Alexandra Lo Cascio
 
Open Web Camp: CSS3 Implementable Features
Open Web Camp: CSS3 Implementable FeaturesOpen Web Camp: CSS3 Implementable Features
Open Web Camp: CSS3 Implementable FeaturesEstelle Weyl
 
Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compassNick Cooley
 
Deep dive into sass
Deep dive into sassDeep dive into sass
Deep dive into sassKnoldus Inc.
 
Atlanta Drupal Users Group - Lightning Talks - Sass
Atlanta Drupal Users Group - Lightning Talks - SassAtlanta Drupal Users Group - Lightning Talks - Sass
Atlanta Drupal Users Group - Lightning Talks - SassEric Sembrat
 
[Worskhop Summits] CSS3 Workshop
[Worskhop Summits] CSS3 Workshop[Worskhop Summits] CSS3 Workshop
[Worskhop Summits] CSS3 WorkshopChristopher Schmitt
 
Quality Development with CSS3
Quality Development with CSS3Quality Development with CSS3
Quality Development with CSS3Shay Howe
 
CSS Box Model and Dimensions
CSS Box Model and DimensionsCSS Box Model and Dimensions
CSS Box Model and DimensionsGerson Abesamis
 
Sass Why for the CSS Guy
Sass Why for the CSS GuySass Why for the CSS Guy
Sass Why for the CSS GuyBeau Smith
 

La actualidad más candente (20)

Introduction to SASS
Introduction to SASSIntroduction to SASS
Introduction to SASS
 
From PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeFrom PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to life
 
Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)
 
Authoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & SassAuthoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & Sass
 
Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)
 
An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)
 
Web Design Trends 2010 - What Is CSS3 All About?
Web Design Trends 2010 - What Is CSS3 All About?Web Design Trends 2010 - What Is CSS3 All About?
Web Design Trends 2010 - What Is CSS3 All About?
 
Open Web Camp: CSS3 Implementable Features
Open Web Camp: CSS3 Implementable FeaturesOpen Web Camp: CSS3 Implementable Features
Open Web Camp: CSS3 Implementable Features
 
Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compass
 
Deep dive into sass
Deep dive into sassDeep dive into sass
Deep dive into sass
 
Css frameworks
Css frameworksCss frameworks
Css frameworks
 
Atlanta Drupal Users Group - Lightning Talks - Sass
Atlanta Drupal Users Group - Lightning Talks - SassAtlanta Drupal Users Group - Lightning Talks - Sass
Atlanta Drupal Users Group - Lightning Talks - Sass
 
[Worskhop Summits] CSS3 Workshop
[Worskhop Summits] CSS3 Workshop[Worskhop Summits] CSS3 Workshop
[Worskhop Summits] CSS3 Workshop
 
Quality Development with CSS3
Quality Development with CSS3Quality Development with CSS3
Quality Development with CSS3
 
CSS Box Model and Dimensions
CSS Box Model and DimensionsCSS Box Model and Dimensions
CSS Box Model and Dimensions
 
Sass presentation
Sass presentationSass presentation
Sass presentation
 
Sass Why for the CSS Guy
Sass Why for the CSS GuySass Why for the CSS Guy
Sass Why for the CSS Guy
 
Css box model
Css  box modelCss  box model
Css box model
 
Intro to CSS3
Intro to CSS3Intro to CSS3
Intro to CSS3
 
Css3
Css3Css3
Css3
 

Similar a Sass compass

SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockMarco Pinheiro
 
Simply Responsive CSS3
Simply Responsive CSS3Simply Responsive CSS3
Simply Responsive CSS3Denise Jacobs
 
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive NewsMobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive NewsKaelig Deloumeau-Prigent
 
CSS3: Ripe and Ready
CSS3: Ripe and ReadyCSS3: Ripe and Ready
CSS3: Ripe and ReadyDenise Jacobs
 
CSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondCSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondDenise Jacobs
 
Rapid Prototyping
Rapid PrototypingRapid Prototyping
Rapid PrototypingEven Wu
 
Learn to love CSS3 | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day DeutschlandLearn to love CSS3 | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day DeutschlandThemePartner
 
Learn to Love CSS3 [English]
Learn to Love CSS3 [English]Learn to Love CSS3 [English]
Learn to Love CSS3 [English]ThemePartner
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & CompassRob Davarnia
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentationMario Noble
 
Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01Anam Hossain
 
CSS preprocessor: why and how
CSS preprocessor: why and howCSS preprocessor: why and how
CSS preprocessor: why and howmirahman
 
Using Sass - Building on CSS
Using Sass - Building on CSSUsing Sass - Building on CSS
Using Sass - Building on CSSSayanee Basu
 
The Basics of CSS3
The Basics of CSS3The Basics of CSS3
The Basics of CSS3joshsurovey
 

Similar a Sass compass (20)

SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, Greensock
 
Simply Responsive CSS3
Simply Responsive CSS3Simply Responsive CSS3
Simply Responsive CSS3
 
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive NewsMobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
 
CSS3: Ripe and Ready
CSS3: Ripe and ReadyCSS3: Ripe and Ready
CSS3: Ripe and Ready
 
CSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondCSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to Respond
 
Rapid Prototyping
Rapid PrototypingRapid Prototyping
Rapid Prototyping
 
CSS3
CSS3CSS3
CSS3
 
Accelerated Stylesheets
Accelerated StylesheetsAccelerated Stylesheets
Accelerated Stylesheets
 
Learn to love CSS3 | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day DeutschlandLearn to love CSS3 | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day Deutschland
 
Learn to Love CSS3 [English]
Learn to Love CSS3 [English]Learn to Love CSS3 [English]
Learn to Love CSS3 [English]
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & Compass
 
Team styles
Team stylesTeam styles
Team styles
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentation
 
Understanding sass
Understanding sassUnderstanding sass
Understanding sass
 
Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01
 
CSS preprocessor: why and how
CSS preprocessor: why and howCSS preprocessor: why and how
CSS preprocessor: why and how
 
Css3 101
Css3 101Css3 101
Css3 101
 
The Future of CSS
The Future of CSSThe Future of CSS
The Future of CSS
 
Using Sass - Building on CSS
Using Sass - Building on CSSUsing Sass - Building on CSS
Using Sass - Building on CSS
 
The Basics of CSS3
The Basics of CSS3The Basics of CSS3
The Basics of CSS3
 

Último

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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
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
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 

Último (20)

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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
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...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
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...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 

Sass compass

  • 2. Who is this guy? Nick Cooley Principal Front-End Architect, TandemSeven: http://www.tandemseven.com @nickcooley
  • 3. Why Use a CSS Framework? • Instead of repetitively implementing patterns and values, you can modularize your CSS. • CSS is limited and difficult to extend by itself. • When prototyping, shouldn’t you focus more on the, you know, prototyping?
  • 4. DRY
  • 5. DRY • “Don’t Repeat Yourself” • Fundamental best practice of CSS frameworks
  • 6. Sass • What is Sass? • Nesting • Vars • Mixins
  • 7. Compass • Save Time! • X-Browser CSS3 mixins • Provides Common CSS development Patterns in an easy-to-use-format
  • 9. What is Sass? • Stands for “Syntactically Awesome StyleSheets” • “Sass both provides a simpler, more elegant syntax for CSS and implements various features that are useful for creating manageable stylesheets.” • Ruby Based
  • 11. Sass: Nesting • CSS: in order to contextually apply selectors, you might need to repeat selectors. • This can be Repetitive, potentially messy and confusing
  • 12. Sass: Nesting •Sass: Allows you to nest selectors within a parent selector. •This provides an approach that’s clean, concise, unique and DRY
  • 14. Sass: Variables • Allow you to quickly parameterize your CSS • Create diverse variations in seconds! • Helps you create design standards for your CSS. • Using a main color in a number of
  • 15. Sass: Variables • Imagine you are using a color as a theme throughout your CSS. • Imagine the $color1 variable spread all over your CSS? How easy to
  • 17. Sass: Mixins • Mixins:Sass :: Functions:Javascript • Allow you to define patterns for reuse • Mixins can be imported across projects, helping you to create your own framework
  • 18. Sass: Mixins • Imagine the following case: You have a standard button theme you use across your site. It has: • Rounded Corners • Gradients • Drop Shadows (multiple) • What would the CSS for such a button look like?
  • 19. Sass: Mixins div[role="main"] li button { border: 1px solid #d8dee7; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #d8dee7)); background-image: -webkit-linear-gradient(#ffffff, #d8dee7); background-image: -moz-linear-gradient(#ffffff, #d8dee7); background-image: -o-linear-gradient(#ffffff, #d8dee7); background-image: -ms-linear-gradient(#ffffff, #d8dee7); background-image: linear-gradient(#ffffff, #d8dee7); padding: 3px 14px; font-size: 12px; color: #3b557d; -webkit-border-radius: 20px 20px; -moz-border-radius: 20px / 20px; -o-border-radius: 20px / 20px; -ms-border-radius: 20px / 20px; -khtml-border-radius: 20px / 20px; border-radius: 20px / 20px; cursor: pointer; } div[role="main"] li button.primary { border: 2px solid #3b557d; padding: 5px 15px; -webkit-border-radius: 22px 22px; -moz-border-radius: 22px / 22px; -o-border-radius: 22px / 22px; -ms-border-radius: 22px / 22px; -khtml-border-radius: 22px / 22px; border-radius: 22px / 22px; } div[role="main"] li button.disabled { opacity: .8; } div[role="main"] li button:hover { background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #d8dee7), color-stop(100%, #ffffff)); background-image: -webkit-linear-gradient(#d8dee7, #ffffff); background-image: -moz-linear-gradient(#d8dee7, #ffffff); background-image: -o-linear-gradient(#d8dee7, #ffffff); background-image: -ms-linear-gradient(#d8dee7, #ffffff); background-image: linear-gradient(#d8dee7, #ffffff); }
  • 21. What is Compass? • “...open-source CSS authoring framework which uses the Sass stylesheet language to make writing stylesheets powerful and easy.” • Provides a number of community- created mixins and modules to help integrate some of the most popular design patterns on the web.
  • 22. Compass • X-Browser CSS3 mixins • Rounded Corners • Box Shadow • Gradients • Text Shadow • Common CSS development Patterns • Reset.css • Sprites • Clearfix • Web Fonts • CSS3 Pie • More!
  • 23. Compass button { border:1px solid #acbed3; @include background-image(linear-gradient(#fff, #d8dee7)); padding:3px 14px; font-size:12px; color:#3b557d; @include border-radius(7px, 7px); cursor:pointer; &.primary { border:2px solid #3b557d; padding:5px 15px; @include border-radius(9px, 9px); } &.disabled { opacity: .8; } &:hover { @include background-image(linear-gradient(#d8dee7, #fff)); } }
  • 24. Compass button { border:1px solid #acbed3; @include background-image(linear-gradient(#fff, #d8dee7)); padding:3px 14px; font-size:12px; color:#3b557d; @include border-radius(7px, 7px); cursor:pointer; &.primary { border:2px solid #3b557d; padding:5px 15px; @include border-radius($border-radius+2, $border-radius+2); } &.disabled { opacity: .8; } &:hover { @include background-image(linear-gradient(#d8dee7, #fff)); } }
  • 25. Compass • Instead of: background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #d8dee7)); background-image: -webkit-linear-gradient(#ffffff, #d8dee7); background-image: -moz-linear-gradient(#ffffff, #d8dee7); background-image: -o-linear-gradient(#ffffff, #d8dee7); background-image: -ms-linear-gradient(#ffffff, #d8dee7); background-image: linear-gradient(#ffffff, #d8dee7); • Compass Provides a mixin for gradients: @include background-image(linear-gradient(#d8dee7, #fff)); • Instead of: -webkit-border-radius: 20px 20px; -moz-border-radius: 20px / 20px; -o-border-radius: 20px / 20px; -ms-border-radius: 20px / 20px; -khtml-border-radius: 20px / 20px; border-radius: 20px / 20px; • Compass Provides a mixin for border-radius: @include border-radius(20px, 20px);
  • 26. How do I use? • Both Sass and Compass are ruby- based applications. • Most users use the terminal to run their instances • If you don’t want to install Ruby or hate command line...
  • 27. Compass.app • Java Based • Available for Windows/Mac/Linux • A number of extensions: HTML5 Boilerplate, Blueprint, 960, and more! • No command line!
  • 28. Demo
  • 29. Links • Sample files: https://gist.github.com/1432176 • Sass Site: http://www.sass-lang.com • Compass Site: http://compass-style.org • Compass.app Site: http://compass.handlino.com/ • Manning Sass Book: http://www.manning.com/netherland/ • https://addons.mozilla.org/en-US/firefox/addon/ firesass-for-firebug/
  • 30. Thank You! • Twitter: @nickcooley • Email: nick@homecooley.com • LinkedIn: http://www.linkedin.com/in/ ncooley

Notas del editor

  1. \n
  2. \n
  3. How many folks use CSS on a regular basis?\nHow many folks use the same color or property over and over again? Making modifying it kind of a pain?\n\nDRY?\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