SlideShare uma empresa Scribd logo
1 de 62
Sass
        :
   CSS




                                                                             011
                                                            ign
       w           ith A




                                                              s
                        ttitu




                                                                  Berlin

                                                                                2
                                                        al De
                              de




                                                                           June
                                                      Drup
                                                             Camp

                                                                         6
                                                                     25+2
                                                   John
                                                        Albin W
                                                   @Joh             ilkins
                                                       nAlbi
http:/                                                        n
      /www
          .flickr
                .com
                    /phot
                          os/phil
                                 yfn/5
                                      5627
                                          5594
                                              3/
Why does CSS suck?
Why does CSS suck?

★ Redundancy
Why does CSS suck?

★ Redundancy
★ #block-menu-block-main-menu-level-tertiary .content a:link {}
     #block-menu-block-main-menu-level-tertiary .content a:visited {}
     #block-menu-block-main-menu-level-tertiary .content a:hover,
     #block-menu-block-main-menu-level-tertiary .content a:focus {}
Why does CSS suck?

★ Redundancy
★ #block-menu-block-main-menu-level-tertiary .content a:link {}
     #block-menu-block-main-menu-level-tertiary .content a:visited {}
     #block-menu-block-main-menu-level-tertiary .content a:hover,
     #block-menu-block-main-menu-level-tertiary .content a:focus {}



★ Redundancy
Why does CSS suck?

★ Redundancy
★ #block-menu-block-main-menu-level-tertiary .content a:link {}
     #block-menu-block-main-menu-level-tertiary .content a:visited {}
     #block-menu-block-main-menu-level-tertiary .content a:hover,
     #block-menu-block-main-menu-level-tertiary .content a:focus {}



★ Redundancy
★ a { color: #cff; }
     .box { border-color: #cff; }
Why does CSS suck?

★ Redundancy
★ #block-menu-block-main-menu-level-tertiary .content a:link {}
     #block-menu-block-main-menu-level-tertiary .content a:visited {}
     #block-menu-block-main-menu-level-tertiary .content a:hover,
     #block-menu-block-main-menu-level-tertiary .content a:focus {}



★ Redundancy
★ a { color: #cff; }
     .box { border-color: #cff; }



★ Redundancy
Why does CSS suck?

★ Redundancy
★ #block-menu-block-main-menu-level-tertiary .content a:link {}
     #block-menu-block-main-menu-level-tertiary .content a:visited {}
     #block-menu-block-main-menu-level-tertiary .content a:hover,
     #block-menu-block-main-menu-level-tertiary .content a:focus {}



★ Redundancy
★ a { color: #cff; }
     .box { border-color: #cff; }



★ Redundancy
     .box {
       -webkit-box-shadow: 1px 1px 10px 3px #ccc;
Why does CSS suck?

★ Redundancy
★ #block-menu-block-main-menu-level-tertiary .content a:link {}
     #block-menu-block-main-menu-level-tertiary .content a:visited {}
     #block-menu-block-main-menu-level-tertiary .content a:hover,
     #block-menu-block-main-menu-level-tertiary .content a:focus {}



★ Redundancy
★ a { color: #cff; }
     .box { border-color: #cff; }



★ Redundancy
     .box {
       -webkit-box-shadow: 1px 1px 10px 3px #ccc;
       -moz-box-shadow: 1px 1px 10px 3px #ccc;
Why does CSS suck?

★ Redundancy
★ #block-menu-block-main-menu-level-tertiary .content a:link {}
     #block-menu-block-main-menu-level-tertiary .content a:visited {}
     #block-menu-block-main-menu-level-tertiary .content a:hover,
     #block-menu-block-main-menu-level-tertiary .content a:focus {}



★ Redundancy
★ a { color: #cff; }
     .box { border-color: #cff; }



★ Redundancy
     .box {
       -webkit-box-shadow: 1px 1px 10px 3px #ccc;
       -moz-box-shadow: 1px 1px 10px 3px #ccc;
       box-shadow: 1px 1px 10px 3px #ccc;
     }
Sass sucks less
Sass sucks less

★ Sass is easy to learn:
  It is CSS + goodies
Sass sucks less

★ Sass is easy to learn:
  It is CSS + goodies


★ Browsers don’t understand sass
Sass sucks less

★ Sass is easy to learn:
  It is CSS + goodies


★ Browsers don’t understand sass



★ Sass is compiled
.empty-rules {}
// and comments
.empty-rules {}
  // and comments

★ // Comments are not in rendered CSS
.empty-rules {}
  // and comments

★ // Comments are not in rendered CSS



★ /* Comments _are_ in rendered CSS */
.empty-rules {}
  // and comments

★ // Comments are not in rendered CSS



★ /* Comments _are_ in rendered CSS */



★ .empty-rulesets {} // Not included.
nested { rules }
nested { rules }
★ .block {
      font-size: 12px;

      h2 {
        font-size: 18px; // Hell, yeah!
      }
  }
nested { rules }
★ .block {
      font-size: 12px;

      h2 {
        font-size: 18px; // Hell, yeah!
      }
  }


★ .block { font-size: 12px; }
  .block h2 { font-size: 20px; }
nested { rules }
nested { rules }

★   #block-menu-block-main-menu-level-tertiary   .content   a:link {}
    #block-menu-block-main-menu-level-tertiary   .content   a:visited {}
    #block-menu-block-main-menu-level-tertiary   .content   a:hover,
    #block-menu-block-main-menu-level-tertiary   .content   a:focus {}
nested { rules }

★   #block-menu-block-main-menu-level-tertiary   .content   a:link {}
    #block-menu-block-main-menu-level-tertiary   .content   a:visited {}
    #block-menu-block-main-menu-level-tertiary   .content   a:hover,
    #block-menu-block-main-menu-level-tertiary   .content   a:focus {}




★   #block-menu-block-main-menu-level-tertiary .content {
      a:link {}
      a:visited {}
      a:hover,
      a:focus {}
    }
nested { rules }

★   #block-menu-block-main-menu-level-tertiary   .content   a:link {}
    #block-menu-block-main-menu-level-tertiary   .content   a:visited {}
    #block-menu-block-main-menu-level-tertiary   .content   a:hover,
    #block-menu-block-main-menu-level-tertiary   .content   a:focus {}




★   #block-menu-block-main-menu-level-tertiary .content {
      a:link {}
      a:visited {}
      a:hover,
      a:focus {}
    }
nested { rules }
nested { rules }
★   .block {
      margin-bottom: 1.5em;

        &.last { // Last block in region
          margin-bottom: 0;
        }
        .body-class & {
          margin-bottom: 2em;
        }
    }
nested { rules }
★   .block {
      margin-bottom: 1.5em;

        &.last { // Last block in region
          margin-bottom: 0;
        }
        .body-class & {
          margin-bottom: 2em;
        }
    }


★   .block { margin-bottom: 1.5em; }
    .block.last { margin-bottom: 0; }
    .body-class .block { margin-bottom: 2em; }
nested-properties
nested-properties

★ border: 2px solid #333;
  border-left: 1px dotted #ccc;
nested-properties

★ border: 2px solid #333;
  border-left: 1px dotted #ccc;


★ border: 2px solid #333 {
      left: 1px dotted #ccc; // border-left
      top {
        width: 1px; // border-top-width
      }
  }
$variables
$variables



★ $blue: #3bbfce;
  $default-font: Georgia, "Times New Roman",
  "DejaVu Serif", serif;
Math * 2
Math * 2



★ $grid-width: 960px / 8;
Math * 2



★ $grid-width: 960px / 8;



★ Any of these: + - * / %
functions()
http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html
functions()
  http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html




★ RGB functions
  rgb(), rgba(), mix()
functions()
  http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html




★ RGB functions
  rgb(), rgba(), mix()

★ HSL functions
  hsla(), lighten(), darken(), desaturate()
functions()
  http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html




★ RGB functions
  rgb(), rgba(), mix()

★ HSL functions
  hsla(), lighten(), darken(), desaturate()

★ Opacity functions
  opacify(), transparentize()
functions()
  http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html




★ RGB functions
  rgb(), rgba(), mix()

★ HSL functions
  hsla(), lighten(), darken(), desaturate()

★ Opacity functions
  opacify(), transparentize()

★ Make your own!                  ponycorn()
_Partials
_Partials

★ Shared resources for your project.
_Partials

★ Shared resources for your project.



★ Name them with an underscore.
  Include them without an underscore.
_Partials

★ Shared resources for your project.



★ Name them with an underscore.
  Include them without an underscore.


★ @include “partial”;
@ mixins
@ mixins



★ #main {
      @include element-invisible;
  }
compile / watch
compile / watch



★ sass sass/style.scss css/style.css
compile / watch



★ sass sass/style.scss css/style.css



★ sass --watch sass:css
FireSass
FireSass




★ sass --debug-info --watch sass:css
Compass
Compass



★ package manager
Compass



★ package manager



★ frameworks/groups of pre-built functionality
compass watch
compass watch



★ The magic is in config.rb
compass watch



★ The magic is in config.rb



★ compass watch .
More Awesome
More Awesome


★ Sass: http://sass-lang.com
More Awesome


★ Sass: http://sass-lang.com



★ Compass: http://compass-style.org
More Awesome


★ Sass: http://sass-lang.com



★ Compass: http://compass-style.org



★ Zen 7.x-5.x

Mais conteúdo relacionado

Destaque

Word List 5
Word List 5Word List 5
Word List 5room8kk
 
Teamwork Rat
Teamwork RatTeamwork Rat
Teamwork Ratlegedug
 
Mobile drupal: building a mobile theme
Mobile drupal: building a mobile themeMobile drupal: building a mobile theme
Mobile drupal: building a mobile themeJohn Albin Wilkins
 
Word List 2
Word List 2Word List 2
Word List 2room8kk
 
Word List 1
Word List 1Word List 1
Word List 1room8kk
 
Word List 4
Word List 4Word List 4
Word List 4room8kk
 
Voicethread Presentation
Voicethread PresentationVoicethread Presentation
Voicethread Presentationroom8kk
 
U learn 2010
U learn 2010U learn 2010
U learn 2010room8kk
 
Promo for ulearn 2011
Promo for ulearn 2011Promo for ulearn 2011
Promo for ulearn 2011room8kk
 
Our Iceberg Is Melting
Our Iceberg Is MeltingOur Iceberg Is Melting
Our Iceberg Is Meltinglegedug
 
FiloDB - Breakthrough OLAP Performance with Cassandra and Spark
FiloDB - Breakthrough OLAP Performance with Cassandra and SparkFiloDB - Breakthrough OLAP Performance with Cassandra and Spark
FiloDB - Breakthrough OLAP Performance with Cassandra and SparkEvan Chan
 

Destaque (11)

Word List 5
Word List 5Word List 5
Word List 5
 
Teamwork Rat
Teamwork RatTeamwork Rat
Teamwork Rat
 
Mobile drupal: building a mobile theme
Mobile drupal: building a mobile themeMobile drupal: building a mobile theme
Mobile drupal: building a mobile theme
 
Word List 2
Word List 2Word List 2
Word List 2
 
Word List 1
Word List 1Word List 1
Word List 1
 
Word List 4
Word List 4Word List 4
Word List 4
 
Voicethread Presentation
Voicethread PresentationVoicethread Presentation
Voicethread Presentation
 
U learn 2010
U learn 2010U learn 2010
U learn 2010
 
Promo for ulearn 2011
Promo for ulearn 2011Promo for ulearn 2011
Promo for ulearn 2011
 
Our Iceberg Is Melting
Our Iceberg Is MeltingOur Iceberg Is Melting
Our Iceberg Is Melting
 
FiloDB - Breakthrough OLAP Performance with Cassandra and Spark
FiloDB - Breakthrough OLAP Performance with Cassandra and SparkFiloDB - Breakthrough OLAP Performance with Cassandra and Spark
FiloDB - Breakthrough OLAP Performance with Cassandra and Spark
 

Semelhante a Sass: CSS with Attitude

The CSS of Tomorrow (Front Row 2011)
The CSS of Tomorrow (Front Row 2011)The CSS of Tomorrow (Front Row 2011)
The CSS of Tomorrow (Front Row 2011)Peter Gasston
 
パフォーマンスから考えるSass/Compassの導入・運用
パフォーマンスから考えるSass/Compassの導入・運用パフォーマンスから考えるSass/Compassの導入・運用
パフォーマンスから考えるSass/Compassの導入・運用Koji Ishimoto
 
The CSS3 of Tomorrow (Version 2)
The CSS3 of Tomorrow (Version 2)The CSS3 of Tomorrow (Version 2)
The CSS3 of Tomorrow (Version 2)Peter Gasston
 
The Home of the Future: CSS Layouts
The Home of the Future: CSS LayoutsThe Home of the Future: CSS Layouts
The Home of the Future: CSS LayoutsPeter Gasston
 
[A5]deview 2012 pt hds webkit_gpu
[A5]deview 2012 pt hds webkit_gpu[A5]deview 2012 pt hds webkit_gpu
[A5]deview 2012 pt hds webkit_gpuNAVER D2
 
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 CompassClaudina Sarahe
 
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
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & CompassRob Davarnia
 
From CSS to Sass in WordPress
From CSS to Sass in WordPressFrom CSS to Sass in WordPress
From CSS to Sass in WordPressJames Steinbach
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockMarco Pinheiro
 
Composer, putting dependencies on the score
Composer, putting dependencies on the scoreComposer, putting dependencies on the score
Composer, putting dependencies on the scoreRafael Dohms
 
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.com
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.comA brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.com
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.comapplicake
 
The New CSS Layout - Dutch PHP Conference
The New CSS Layout - Dutch PHP ConferenceThe New CSS Layout - Dutch PHP Conference
The New CSS Layout - Dutch PHP ConferenceRachel Andrew
 
[WebVisions 2010] CSS3 Workshop (Afternoon)
[WebVisions 2010] CSS3 Workshop (Afternoon)[WebVisions 2010] CSS3 Workshop (Afternoon)
[WebVisions 2010] CSS3 Workshop (Afternoon)Christopher Schmitt
 

Semelhante a Sass: CSS with Attitude (20)

LESS
LESSLESS
LESS
 
The CSS of Tomorrow (Front Row 2011)
The CSS of Tomorrow (Front Row 2011)The CSS of Tomorrow (Front Row 2011)
The CSS of Tomorrow (Front Row 2011)
 
パフォーマンスから考えるSass/Compassの導入・運用
パフォーマンスから考えるSass/Compassの導入・運用パフォーマンスから考えるSass/Compassの導入・運用
パフォーマンスから考えるSass/Compassの導入・運用
 
The CSS3 of Tomorrow (Version 2)
The CSS3 of Tomorrow (Version 2)The CSS3 of Tomorrow (Version 2)
The CSS3 of Tomorrow (Version 2)
 
The Home of the Future: CSS Layouts
The Home of the Future: CSS LayoutsThe Home of the Future: CSS Layouts
The Home of the Future: CSS Layouts
 
[A5]deview 2012 pt hds webkit_gpu
[A5]deview 2012 pt hds webkit_gpu[A5]deview 2012 pt hds webkit_gpu
[A5]deview 2012 pt hds webkit_gpu
 
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
 
CSS3 Layout
CSS3 LayoutCSS3 Layout
CSS3 Layout
 
Sass&compass
Sass&compassSass&compass
Sass&compass
 
CSS Wish List @JSConf
CSS Wish List @JSConfCSS Wish List @JSConf
CSS Wish List @JSConf
 
CSS3 3D Workshop
CSS3 3D WorkshopCSS3 3D Workshop
CSS3 3D Workshop
 
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
Css3Css3
Css3
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & Compass
 
From CSS to Sass in WordPress
From CSS to Sass in WordPressFrom CSS to Sass in WordPress
From CSS to Sass in WordPress
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, Greensock
 
Composer, putting dependencies on the score
Composer, putting dependencies on the scoreComposer, putting dependencies on the score
Composer, putting dependencies on the score
 
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.com
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.comA brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.com
A brief look at CSS3 techniques by Aaron Rodgers, Web Designer @ vzaar.com
 
The New CSS Layout - Dutch PHP Conference
The New CSS Layout - Dutch PHP ConferenceThe New CSS Layout - Dutch PHP Conference
The New CSS Layout - Dutch PHP Conference
 
[WebVisions 2010] CSS3 Workshop (Afternoon)
[WebVisions 2010] CSS3 Workshop (Afternoon)[WebVisions 2010] CSS3 Workshop (Afternoon)
[WebVisions 2010] CSS3 Workshop (Afternoon)
 

Mais de John Albin Wilkins

Using the CSS Nesting Spec Today
Using the CSS Nesting Spec TodayUsing the CSS Nesting Spec Today
Using the CSS Nesting Spec TodayJohn Albin Wilkins
 
The Drupal Roadmap: From D7 to D9
The Drupal Roadmap: From D7 to D9The Drupal Roadmap: From D7 to D9
The Drupal Roadmap: From D7 to D9John Albin Wilkins
 
CSS-in-JS: unexpected lessons for Drupal component design
CSS-in-JS: unexpected lessons for Drupal component designCSS-in-JS: unexpected lessons for Drupal component design
CSS-in-JS: unexpected lessons for Drupal component designJohn Albin Wilkins
 
Style Guide Driven Development: All Hail the Robot Overlords!
Style Guide Driven Development: All Hail the Robot Overlords!Style Guide Driven Development: All Hail the Robot Overlords!
Style Guide Driven Development: All Hail the Robot Overlords!John Albin Wilkins
 
Styleguide-Driven Development: The New Web Development
Styleguide-Driven Development: The New Web DevelopmentStyleguide-Driven Development: The New Web Development
Styleguide-Driven Development: The New Web DevelopmentJohn Albin Wilkins
 
Managing Complex Projects with Design Components - Drupalcon Austin 2014
Managing Complex Projects with Design Components - Drupalcon Austin 2014Managing Complex Projects with Design Components - Drupalcon Austin 2014
Managing Complex Projects with Design Components - Drupalcon Austin 2014John Albin Wilkins
 
DrupalSouth 2014: Managing Complex Projects with Design Components
DrupalSouth 2014: Managing Complex Projects with Design ComponentsDrupalSouth 2014: Managing Complex Projects with Design Components
DrupalSouth 2014: Managing Complex Projects with Design ComponentsJohn Albin Wilkins
 
SassConf: Managing Complex Projects with Design Components
SassConf: Managing Complex Projects with Design ComponentsSassConf: Managing Complex Projects with Design Components
SassConf: Managing Complex Projects with Design ComponentsJohn Albin Wilkins
 
Become an IA superstar (Chinese version)
Become an IA superstar (Chinese version)Become an IA superstar (Chinese version)
Become an IA superstar (Chinese version)John Albin Wilkins
 
Drupal and the Future of the Web
Drupal and the Future of the WebDrupal and the Future of the Web
Drupal and the Future of the WebJohn Albin Wilkins
 
Default theme implementations: a guide for module developers that want sweet ...
Default theme implementations: a guide for module developers that want sweet ...Default theme implementations: a guide for module developers that want sweet ...
Default theme implementations: a guide for module developers that want sweet ...John Albin Wilkins
 
New Adventures in Drupal Theming
New Adventures in Drupal ThemingNew Adventures in Drupal Theming
New Adventures in Drupal ThemingJohn Albin Wilkins
 
Making Drupal Dance: Techniques for Non-obvious Theme Manipulations
Making Drupal Dance: Techniques for Non-obvious Theme ManipulationsMaking Drupal Dance: Techniques for Non-obvious Theme Manipulations
Making Drupal Dance: Techniques for Non-obvious Theme ManipulationsJohn Albin Wilkins
 

Mais de John Albin Wilkins (20)

Using the CSS Nesting Spec Today
Using the CSS Nesting Spec TodayUsing the CSS Nesting Spec Today
Using the CSS Nesting Spec Today
 
The Drupal Roadmap: From D7 to D9
The Drupal Roadmap: From D7 to D9The Drupal Roadmap: From D7 to D9
The Drupal Roadmap: From D7 to D9
 
Mastering Drupal 8’s Twig
Mastering Drupal 8’s TwigMastering Drupal 8’s Twig
Mastering Drupal 8’s Twig
 
CSS-in-JS: unexpected lessons for Drupal component design
CSS-in-JS: unexpected lessons for Drupal component designCSS-in-JS: unexpected lessons for Drupal component design
CSS-in-JS: unexpected lessons for Drupal component design
 
Style Guide Driven Development: All Hail the Robot Overlords!
Style Guide Driven Development: All Hail the Robot Overlords!Style Guide Driven Development: All Hail the Robot Overlords!
Style Guide Driven Development: All Hail the Robot Overlords!
 
Styleguide-Driven Development: The New Web Development
Styleguide-Driven Development: The New Web DevelopmentStyleguide-Driven Development: The New Web Development
Styleguide-Driven Development: The New Web Development
 
Managing Complex Projects with Design Components - Drupalcon Austin 2014
Managing Complex Projects with Design Components - Drupalcon Austin 2014Managing Complex Projects with Design Components - Drupalcon Austin 2014
Managing Complex Projects with Design Components - Drupalcon Austin 2014
 
DrupalSouth 2014: Managing Complex Projects with Design Components
DrupalSouth 2014: Managing Complex Projects with Design ComponentsDrupalSouth 2014: Managing Complex Projects with Design Components
DrupalSouth 2014: Managing Complex Projects with Design Components
 
SassConf: Managing Complex Projects with Design Components
SassConf: Managing Complex Projects with Design ComponentsSassConf: Managing Complex Projects with Design Components
SassConf: Managing Complex Projects with Design Components
 
Drupal Camp Taipei Keynote
Drupal Camp Taipei KeynoteDrupal Camp Taipei Keynote
Drupal Camp Taipei Keynote
 
Become an IA superstar (Chinese version)
Become an IA superstar (Chinese version)Become an IA superstar (Chinese version)
Become an IA superstar (Chinese version)
 
Mastering zen
Mastering zenMastering zen
Mastering zen
 
Drupal and the Future of the Web
Drupal and the Future of the WebDrupal and the Future of the Web
Drupal and the Future of the Web
 
What's new in D7 Theming?
What's new in D7 Theming?What's new in D7 Theming?
What's new in D7 Theming?
 
Default theme implementations: a guide for module developers that want sweet ...
Default theme implementations: a guide for module developers that want sweet ...Default theme implementations: a guide for module developers that want sweet ...
Default theme implementations: a guide for module developers that want sweet ...
 
Rocking the Theme Layer
Rocking the Theme LayerRocking the Theme Layer
Rocking the Theme Layer
 
Drupal Design Tips
Drupal Design TipsDrupal Design Tips
Drupal Design Tips
 
New Adventures in Drupal Theming
New Adventures in Drupal ThemingNew Adventures in Drupal Theming
New Adventures in Drupal Theming
 
Nanocon Taiwan
Nanocon TaiwanNanocon Taiwan
Nanocon Taiwan
 
Making Drupal Dance: Techniques for Non-obvious Theme Manipulations
Making Drupal Dance: Techniques for Non-obvious Theme ManipulationsMaking Drupal Dance: Techniques for Non-obvious Theme Manipulations
Making Drupal Dance: Techniques for Non-obvious Theme Manipulations
 

Último

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
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
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
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
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
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
 
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
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
[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
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 

Último (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
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
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
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
 
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
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 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
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 

Sass: CSS with Attitude

  • 1. Sass : CSS 011 ign w ith A s ttitu Berlin 2 al De de June Drup Camp 6 25+2 John Albin W @Joh ilkins nAlbi http:/ n /www .flickr .com /phot os/phil yfn/5 5627 5594 3/
  • 2. Why does CSS suck?
  • 3. Why does CSS suck? ★ Redundancy
  • 4. Why does CSS suck? ★ Redundancy ★ #block-menu-block-main-menu-level-tertiary .content a:link {} #block-menu-block-main-menu-level-tertiary .content a:visited {} #block-menu-block-main-menu-level-tertiary .content a:hover, #block-menu-block-main-menu-level-tertiary .content a:focus {}
  • 5. Why does CSS suck? ★ Redundancy ★ #block-menu-block-main-menu-level-tertiary .content a:link {} #block-menu-block-main-menu-level-tertiary .content a:visited {} #block-menu-block-main-menu-level-tertiary .content a:hover, #block-menu-block-main-menu-level-tertiary .content a:focus {} ★ Redundancy
  • 6. Why does CSS suck? ★ Redundancy ★ #block-menu-block-main-menu-level-tertiary .content a:link {} #block-menu-block-main-menu-level-tertiary .content a:visited {} #block-menu-block-main-menu-level-tertiary .content a:hover, #block-menu-block-main-menu-level-tertiary .content a:focus {} ★ Redundancy ★ a { color: #cff; } .box { border-color: #cff; }
  • 7. Why does CSS suck? ★ Redundancy ★ #block-menu-block-main-menu-level-tertiary .content a:link {} #block-menu-block-main-menu-level-tertiary .content a:visited {} #block-menu-block-main-menu-level-tertiary .content a:hover, #block-menu-block-main-menu-level-tertiary .content a:focus {} ★ Redundancy ★ a { color: #cff; } .box { border-color: #cff; } ★ Redundancy
  • 8. Why does CSS suck? ★ Redundancy ★ #block-menu-block-main-menu-level-tertiary .content a:link {} #block-menu-block-main-menu-level-tertiary .content a:visited {} #block-menu-block-main-menu-level-tertiary .content a:hover, #block-menu-block-main-menu-level-tertiary .content a:focus {} ★ Redundancy ★ a { color: #cff; } .box { border-color: #cff; } ★ Redundancy .box { -webkit-box-shadow: 1px 1px 10px 3px #ccc;
  • 9. Why does CSS suck? ★ Redundancy ★ #block-menu-block-main-menu-level-tertiary .content a:link {} #block-menu-block-main-menu-level-tertiary .content a:visited {} #block-menu-block-main-menu-level-tertiary .content a:hover, #block-menu-block-main-menu-level-tertiary .content a:focus {} ★ Redundancy ★ a { color: #cff; } .box { border-color: #cff; } ★ Redundancy .box { -webkit-box-shadow: 1px 1px 10px 3px #ccc; -moz-box-shadow: 1px 1px 10px 3px #ccc;
  • 10. Why does CSS suck? ★ Redundancy ★ #block-menu-block-main-menu-level-tertiary .content a:link {} #block-menu-block-main-menu-level-tertiary .content a:visited {} #block-menu-block-main-menu-level-tertiary .content a:hover, #block-menu-block-main-menu-level-tertiary .content a:focus {} ★ Redundancy ★ a { color: #cff; } .box { border-color: #cff; } ★ Redundancy .box { -webkit-box-shadow: 1px 1px 10px 3px #ccc; -moz-box-shadow: 1px 1px 10px 3px #ccc; box-shadow: 1px 1px 10px 3px #ccc; }
  • 12. Sass sucks less ★ Sass is easy to learn: It is CSS + goodies
  • 13. Sass sucks less ★ Sass is easy to learn: It is CSS + goodies ★ Browsers don’t understand sass
  • 14. Sass sucks less ★ Sass is easy to learn: It is CSS + goodies ★ Browsers don’t understand sass ★ Sass is compiled
  • 16. .empty-rules {} // and comments ★ // Comments are not in rendered CSS
  • 17. .empty-rules {} // and comments ★ // Comments are not in rendered CSS ★ /* Comments _are_ in rendered CSS */
  • 18. .empty-rules {} // and comments ★ // Comments are not in rendered CSS ★ /* Comments _are_ in rendered CSS */ ★ .empty-rulesets {} // Not included.
  • 20. nested { rules } ★ .block { font-size: 12px; h2 { font-size: 18px; // Hell, yeah! } }
  • 21. nested { rules } ★ .block { font-size: 12px; h2 { font-size: 18px; // Hell, yeah! } } ★ .block { font-size: 12px; } .block h2 { font-size: 20px; }
  • 23. nested { rules } ★ #block-menu-block-main-menu-level-tertiary .content a:link {} #block-menu-block-main-menu-level-tertiary .content a:visited {} #block-menu-block-main-menu-level-tertiary .content a:hover, #block-menu-block-main-menu-level-tertiary .content a:focus {}
  • 24. nested { rules } ★ #block-menu-block-main-menu-level-tertiary .content a:link {} #block-menu-block-main-menu-level-tertiary .content a:visited {} #block-menu-block-main-menu-level-tertiary .content a:hover, #block-menu-block-main-menu-level-tertiary .content a:focus {} ★ #block-menu-block-main-menu-level-tertiary .content { a:link {} a:visited {} a:hover, a:focus {} }
  • 25. nested { rules } ★ #block-menu-block-main-menu-level-tertiary .content a:link {} #block-menu-block-main-menu-level-tertiary .content a:visited {} #block-menu-block-main-menu-level-tertiary .content a:hover, #block-menu-block-main-menu-level-tertiary .content a:focus {} ★ #block-menu-block-main-menu-level-tertiary .content { a:link {} a:visited {} a:hover, a:focus {} }
  • 27. nested { rules } ★ .block { margin-bottom: 1.5em; &.last { // Last block in region margin-bottom: 0; } .body-class & { margin-bottom: 2em; } }
  • 28. nested { rules } ★ .block { margin-bottom: 1.5em; &.last { // Last block in region margin-bottom: 0; } .body-class & { margin-bottom: 2em; } } ★ .block { margin-bottom: 1.5em; } .block.last { margin-bottom: 0; } .body-class .block { margin-bottom: 2em; }
  • 30. nested-properties ★ border: 2px solid #333; border-left: 1px dotted #ccc;
  • 31. nested-properties ★ border: 2px solid #333; border-left: 1px dotted #ccc; ★ border: 2px solid #333 { left: 1px dotted #ccc; // border-left top { width: 1px; // border-top-width } }
  • 33. $variables ★ $blue: #3bbfce; $default-font: Georgia, "Times New Roman", "DejaVu Serif", serif;
  • 35. Math * 2 ★ $grid-width: 960px / 8;
  • 36. Math * 2 ★ $grid-width: 960px / 8; ★ Any of these: + - * / %
  • 39. functions() http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html ★ RGB functions rgb(), rgba(), mix() ★ HSL functions hsla(), lighten(), darken(), desaturate()
  • 40. functions() http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html ★ RGB functions rgb(), rgba(), mix() ★ HSL functions hsla(), lighten(), darken(), desaturate() ★ Opacity functions opacify(), transparentize()
  • 41. functions() http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html ★ RGB functions rgb(), rgba(), mix() ★ HSL functions hsla(), lighten(), darken(), desaturate() ★ Opacity functions opacify(), transparentize() ★ Make your own! ponycorn()
  • 43. _Partials ★ Shared resources for your project.
  • 44. _Partials ★ Shared resources for your project. ★ Name them with an underscore. Include them without an underscore.
  • 45. _Partials ★ Shared resources for your project. ★ Name them with an underscore. Include them without an underscore. ★ @include “partial”;
  • 47. @ mixins ★ #main { @include element-invisible; }
  • 49. compile / watch ★ sass sass/style.scss css/style.css
  • 50. compile / watch ★ sass sass/style.scss css/style.css ★ sass --watch sass:css
  • 52. FireSass ★ sass --debug-info --watch sass:css
  • 55. Compass ★ package manager ★ frameworks/groups of pre-built functionality
  • 57. compass watch ★ The magic is in config.rb
  • 58. compass watch ★ The magic is in config.rb ★ compass watch .
  • 60. More Awesome ★ Sass: http://sass-lang.com
  • 61. More Awesome ★ Sass: http://sass-lang.com ★ Compass: http://compass-style.org
  • 62. More Awesome ★ Sass: http://sass-lang.com ★ Compass: http://compass-style.org ★ Zen 7.x-5.x

Notas do Editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n