SlideShare uma empresa Scribd logo
1 de 17
Baixar para ler offline
Please use Compass/Sass for Themes
If I may… And other whys answered.
!
!
by Chris Charlton http://xtnd.us
For & Against
2
Preaching to the choir here.
Arguments For
‣ Write and maintain less code.
‣ Easily generate aesthetically pleasing color schemes.
‣ Wonderful, easy support for bitmap & vector graphics.
‣ Be dynamic and responsive (not in the mobile sense).
‣ Evolve.
3
You’re that guy.
Arguments Against
‣ “It’s just another thing to learn.”
‣ “What’s wrong with regular CSS?”
‣ “What if the user doesn’t know Sass?”
‣ “It was trouble to get PHP running, now I need Ruby?!”
‣ “Sass has too many files. One CSS file is all I need!”
4
For
5
Even your first Sass theme will feel good. Imagine you, but 2.0
Write less code
‣ Nesting, Variables, Mixins, [stupid] Vendor prefixes, etc.
‣ Sub-themes and variants are tiny.
‣ CSS output control; scrubbed, minified, and compressed.
‣ New modular styles answer where to organize things.
6
7
$white : #FFFFFF;	
$light : #EEEEEE;	
$dark : #666666;
8
theme/layout/grid.scss	
theme/modules/buttons.scss	
theme/modules/callouts.scss	
theme/base.scss
Don’t let programmers choose colors.
Color
// Sass	
mix(...); // Mix two colors	
complement(...); // Complementary	
invert(...); // Invert color	
// Compass	
shade(...); // Darken	
tint(...); // Lighten	
contrasted(...); // Smart	
// “compass-colors” gem provides more	
9
It’s “mind bottling.”
Great bitmap & vector graphics support
‣ Auto-generate Image Sprites from image folders
‣ Leverage dynamic vector and graphic functions.
‣ Leverage CSS3 effects & graphics capabilities
• shapes, masks, rounded corners, shadows, glows, gradients
10
11
.element {	
// Find image by name	
background-image: image-url("icon.png");	
}
12
$image: url("images/example.png");	
!
.element {	
// No need to hardcode image sizes	
height: image-height($image);	
}
13
// Output green spritesheet + classes	
@import "images/green/*.png";	
@include all-green-sprites;	
!
!
// Output blue spritesheet	
@import "images/blue/*.png";	
!
.element {	
@include background(blue-sprite(icon));	
height: blue-sprite-height(icon);	
width: blue-sprite-width(icon);	
}
True Sass Ninjas cuts three columns in one swipe.
Be dynamic! (Responsive is in next slide)
‣ Conditional logic for dynamic column styles.
‣ Centralizing colors (and images) makes for easier, and
better customization. Maintenance profit.
‣ Leverage Sass mixins & functions to reproduce graphics
to eliminate shipping with resolution-limited bitmaps.
‣ CSS3 animations & transformations bring themes alive!
14
Mobile - BOOM!
Now be RESPONSIVE
‣ This is your next frontier when done with Sass basics.
‣ Good excuse to buy that tablet or any other device.
‣ Motivation to use SVG along with PNG.
15
CSS3 - BOOM!
Build on top of CSS3
‣ This is the new frontier in standards compliance.
‣ Another good excuse to buy that new tablet/device.
‣ Another excuse to use SVG along with PNG.
16
Fin
17

Mais conteúdo relacionado

Destaque

A construcao do_modelo_de_capacitacao_do_gestor_publico_estrategico_do_espiri...
A construcao do_modelo_de_capacitacao_do_gestor_publico_estrategico_do_espiri...A construcao do_modelo_de_capacitacao_do_gestor_publico_estrategico_do_espiri...
A construcao do_modelo_de_capacitacao_do_gestor_publico_estrategico_do_espiri...
Tania Madeira
 
Tema 5 -_as_-_modelacao_do_fluxo_de_dados_-_dc_dfd_2009
Tema 5 -_as_-_modelacao_do_fluxo_de_dados_-_dc_dfd_2009Tema 5 -_as_-_modelacao_do_fluxo_de_dados_-_dc_dfd_2009
Tema 5 -_as_-_modelacao_do_fluxo_de_dados_-_dc_dfd_2009
Pedro A. Uamusse
 
Lesson 1. range of connectives
Lesson 1. range of connectivesLesson 1. range of connectives
Lesson 1. range of connectives
pgslearning
 
Sugestoes ferramentas
Sugestoes ferramentasSugestoes ferramentas
Sugestoes ferramentas
Marli Regis
 
архитектура построение и перспектива рисунка
архитектура построение и перспектива рисункаархитектура построение и перспектива рисунка
архитектура построение и перспектива рисунка
Денис Семыкин
 
endovascular.es Newsletter i:2012
endovascular.es Newsletter i:2012endovascular.es Newsletter i:2012
endovascular.es Newsletter i:2012
Salutaria
 
Charla lectura carmen najera
Charla lectura carmen najeraCharla lectura carmen najera
Charla lectura carmen najera
institutodeolvega
 

Destaque (18)

The family
The familyThe family
The family
 
A construcao do_modelo_de_capacitacao_do_gestor_publico_estrategico_do_espiri...
A construcao do_modelo_de_capacitacao_do_gestor_publico_estrategico_do_espiri...A construcao do_modelo_de_capacitacao_do_gestor_publico_estrategico_do_espiri...
A construcao do_modelo_de_capacitacao_do_gestor_publico_estrategico_do_espiri...
 
Mar
MarMar
Mar
 
Bellbird. Pájaro campana
Bellbird. Pájaro campanaBellbird. Pájaro campana
Bellbird. Pájaro campana
 
5 langkah mengubah ide menjadi sebuah produk
5 langkah mengubah ide menjadi sebuah produk5 langkah mengubah ide menjadi sebuah produk
5 langkah mengubah ide menjadi sebuah produk
 
Guia del participante
Guia del participanteGuia del participante
Guia del participante
 
Acesso pc
Acesso pcAcesso pc
Acesso pc
 
(Webinar) Unlocking Mobile Conversions - Featuring Guest Presenter Charles Ni...
(Webinar) Unlocking Mobile Conversions - Featuring Guest Presenter Charles Ni...(Webinar) Unlocking Mobile Conversions - Featuring Guest Presenter Charles Ni...
(Webinar) Unlocking Mobile Conversions - Featuring Guest Presenter Charles Ni...
 
Tema 5 -_as_-_modelacao_do_fluxo_de_dados_-_dc_dfd_2009
Tema 5 -_as_-_modelacao_do_fluxo_de_dados_-_dc_dfd_2009Tema 5 -_as_-_modelacao_do_fluxo_de_dados_-_dc_dfd_2009
Tema 5 -_as_-_modelacao_do_fluxo_de_dados_-_dc_dfd_2009
 
Changes to JHSC Certification Training
Changes to JHSC Certification TrainingChanges to JHSC Certification Training
Changes to JHSC Certification Training
 
De kracht van gamification #DML12
De kracht van gamification #DML12De kracht van gamification #DML12
De kracht van gamification #DML12
 
Lesson 1. range of connectives
Lesson 1. range of connectivesLesson 1. range of connectives
Lesson 1. range of connectives
 
Pinturas terremoto.Earthquake paintings (Japón 1923)
Pinturas terremoto.Earthquake paintings (Japón 1923)Pinturas terremoto.Earthquake paintings (Japón 1923)
Pinturas terremoto.Earthquake paintings (Japón 1923)
 
Sugestoes ferramentas
Sugestoes ferramentasSugestoes ferramentas
Sugestoes ferramentas
 
архитектура построение и перспектива рисунка
архитектура построение и перспектива рисункаархитектура построение и перспектива рисунка
архитектура построение и перспектива рисунка
 
endovascular.es Newsletter i:2012
endovascular.es Newsletter i:2012endovascular.es Newsletter i:2012
endovascular.es Newsletter i:2012
 
Charla lectura carmen najera
Charla lectura carmen najeraCharla lectura carmen najera
Charla lectura carmen najera
 
Comunicación política para gremialistas
Comunicación política para gremialistasComunicación política para gremialistas
Comunicación política para gremialistas
 

Mais de Chris Charlton

Lightning Talk: Drush aliases (Drupal Camp LA 2013)
Lightning Talk: Drush aliases (Drupal Camp LA 2013)Lightning Talk: Drush aliases (Drupal Camp LA 2013)
Lightning Talk: Drush aliases (Drupal Camp LA 2013)
Chris Charlton
 
Site Aliases: Powerful Drupal Administration Using Drush by Chris Charlton
Site Aliases: Powerful Drupal Administration Using Drush by Chris CharltonSite Aliases: Powerful Drupal Administration Using Drush by Chris Charlton
Site Aliases: Powerful Drupal Administration Using Drush by Chris Charlton
Chris Charlton
 
Policy File: Powerful Drupal Administration Using Drush
Policy File: Powerful Drupal Administration Using DrushPolicy File: Powerful Drupal Administration Using Drush
Policy File: Powerful Drupal Administration Using Drush
Chris Charlton
 

Mais de Chris Charlton (12)

Drupal Form API 101 (PHP) - DrupalCamp LA 2012
Drupal Form API 101 (PHP) - DrupalCamp LA 2012Drupal Form API 101 (PHP) - DrupalCamp LA 2012
Drupal Form API 101 (PHP) - DrupalCamp LA 2012
 
Drupal Developer Skills (2012) - DrupalCamp LA 2012
Drupal Developer Skills (2012) - DrupalCamp LA 2012Drupal Developer Skills (2012) - DrupalCamp LA 2012
Drupal Developer Skills (2012) - DrupalCamp LA 2012
 
Sassy CSS (part 2) (Drupal Camp LA 2013)
Sassy CSS (part 2) (Drupal Camp LA 2013)Sassy CSS (part 2) (Drupal Camp LA 2013)
Sassy CSS (part 2) (Drupal Camp LA 2013)
 
Lightning Talk: Drush aliases (Drupal Camp LA 2013)
Lightning Talk: Drush aliases (Drupal Camp LA 2013)Lightning Talk: Drush aliases (Drupal Camp LA 2013)
Lightning Talk: Drush aliases (Drupal Camp LA 2013)
 
Site Aliases: Powerful Drupal Administration Using Drush by Chris Charlton
Site Aliases: Powerful Drupal Administration Using Drush by Chris CharltonSite Aliases: Powerful Drupal Administration Using Drush by Chris Charlton
Site Aliases: Powerful Drupal Administration Using Drush by Chris Charlton
 
Policy File: Powerful Drupal Administration Using Drush
Policy File: Powerful Drupal Administration Using DrushPolicy File: Powerful Drupal Administration Using Drush
Policy File: Powerful Drupal Administration Using Drush
 
Drush 5.0 (DrupalCamp LA 2012) - Chris Charlton
Drush 5.0 (DrupalCamp LA 2012) - Chris CharltonDrush 5.0 (DrupalCamp LA 2012) - Chris Charlton
Drush 5.0 (DrupalCamp LA 2012) - Chris Charlton
 
Changes to Drupal Themes in version 7 (part 1)
Changes to Drupal Themes in version 7 (part 1)Changes to Drupal Themes in version 7 (part 1)
Changes to Drupal Themes in version 7 (part 1)
 
Web Content Management Systems From A Designer's Perspective (Drupal Technica...
Web Content Management Systems From A Designer's Perspective (Drupal Technica...Web Content Management Systems From A Designer's Perspective (Drupal Technica...
Web Content Management Systems From A Designer's Perspective (Drupal Technica...
 
Let's Zen! (Stop Theming From Scratch)
Let's Zen! (Stop Theming From Scratch)Let's Zen! (Stop Theming From Scratch)
Let's Zen! (Stop Theming From Scratch)
 
Flex Flash Air Interfaces for Custom Content Types in Drupal Chris Charlton
Flex Flash Air Interfaces for Custom Content Types in Drupal   Chris CharltonFlex Flash Air Interfaces for Custom Content Types in Drupal   Chris Charlton
Flex Flash Air Interfaces for Custom Content Types in Drupal Chris Charlton
 
Better Drupal Interaction Design with Flex
Better Drupal Interaction Design with FlexBetter Drupal Interaction Design with Flex
Better Drupal Interaction Design with Flex
 

Último

%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Último (20)

MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 

Drupal Themes should use Compass (Drupal Camp LA 2013)

  • 1. Please use Compass/Sass for Themes If I may… And other whys answered. ! ! by Chris Charlton http://xtnd.us
  • 3. Preaching to the choir here. Arguments For ‣ Write and maintain less code. ‣ Easily generate aesthetically pleasing color schemes. ‣ Wonderful, easy support for bitmap & vector graphics. ‣ Be dynamic and responsive (not in the mobile sense). ‣ Evolve. 3
  • 4. You’re that guy. Arguments Against ‣ “It’s just another thing to learn.” ‣ “What’s wrong with regular CSS?” ‣ “What if the user doesn’t know Sass?” ‣ “It was trouble to get PHP running, now I need Ruby?!” ‣ “Sass has too many files. One CSS file is all I need!” 4
  • 6. Even your first Sass theme will feel good. Imagine you, but 2.0 Write less code ‣ Nesting, Variables, Mixins, [stupid] Vendor prefixes, etc. ‣ Sub-themes and variants are tiny. ‣ CSS output control; scrubbed, minified, and compressed. ‣ New modular styles answer where to organize things. 6
  • 7. 7 $white : #FFFFFF; $light : #EEEEEE; $dark : #666666;
  • 9. Don’t let programmers choose colors. Color // Sass mix(...); // Mix two colors complement(...); // Complementary invert(...); // Invert color // Compass shade(...); // Darken tint(...); // Lighten contrasted(...); // Smart // “compass-colors” gem provides more 9
  • 10. It’s “mind bottling.” Great bitmap & vector graphics support ‣ Auto-generate Image Sprites from image folders ‣ Leverage dynamic vector and graphic functions. ‣ Leverage CSS3 effects & graphics capabilities • shapes, masks, rounded corners, shadows, glows, gradients 10
  • 11. 11 .element { // Find image by name background-image: image-url("icon.png"); }
  • 12. 12 $image: url("images/example.png"); ! .element { // No need to hardcode image sizes height: image-height($image); }
  • 13. 13 // Output green spritesheet + classes @import "images/green/*.png"; @include all-green-sprites; ! ! // Output blue spritesheet @import "images/blue/*.png"; ! .element { @include background(blue-sprite(icon)); height: blue-sprite-height(icon); width: blue-sprite-width(icon); }
  • 14. True Sass Ninjas cuts three columns in one swipe. Be dynamic! (Responsive is in next slide) ‣ Conditional logic for dynamic column styles. ‣ Centralizing colors (and images) makes for easier, and better customization. Maintenance profit. ‣ Leverage Sass mixins & functions to reproduce graphics to eliminate shipping with resolution-limited bitmaps. ‣ CSS3 animations & transformations bring themes alive! 14
  • 15. Mobile - BOOM! Now be RESPONSIVE ‣ This is your next frontier when done with Sass basics. ‣ Good excuse to buy that tablet or any other device. ‣ Motivation to use SVG along with PNG. 15
  • 16. CSS3 - BOOM! Build on top of CSS3 ‣ This is the new frontier in standards compliance. ‣ Another good excuse to buy that new tablet/device. ‣ Another excuse to use SVG along with PNG. 16