SlideShare una empresa de Scribd logo
1 de 23
Descargar para leer sin conexión
RESPONSIVE DRUPAL
THEMING MET SASS,
COMPASS, SUSY EN
AURORA
DRUPAL TECH TALK 25 APRIL 2013
MARC VAN GEND TRIQUANTA
AGENDA
Het Doel – #responsivemobilefirsthtml5buzzwordcompliant
CSS preprocessing – SASS
Werken met SASS – Compass
De 2e generatie CSS grid systems – Susy
Combineren tot een Drupal theme – Aurora
De grote gevaarlijke onvermijdelijke live demo – or it didn't happen
HET DOEL
#RESPONSIVEMOBILEFIRSTHTML5BUZZWORDCOMPLIANT
Responsive – één site voor alle schermen
Progressive enhancement – functioneel » fraai » funky
Mobile first – eerst simpel, dan groeien
HTML5 – is beter, kan meer
Werkbaar – samenwerken, onderhouden, uitbreiden
CSS PREPROCESSING
EN WAT IS SASS EIGENLIJK?
SASS: “programmeren met stylesheets”
.scss syntax: superset van CSS
variables
nesting
mixins
SASS: VARIABLES
$triquanta-blue: #00c2ff;
$gutter: 16px;
.quote {
margin: $gutter;
padding: $gutter / 2;
color: $triquanta-blue;
}
.quote {
margin: 16px;
padding: 8px;
color: #00c2ff;
}
SASS: NESTING
.menu li {
float: left;
a {
color: #cc0000;
}
}
.menu li {
float: left;
}
.menu li a {
color: #cc0000;
}
SASS: MIXINS
@mixin box($color, $border:true) {
padding: 1em;
background-color: $color;
@if $border {
border: 1px solid #000000;
}
}
.node {
@include box(#006600);
}
.quote {
@include box(#333333, false);
}
.node {
padding: 1em;
background-color: #006600;
border: 1px solid #000000;
}
.quote {
padding: 1em;
background: #333333;
}
COMPASS
ZET SASS AAN HET WERK
Gereedschapskist – doet niet de afwas
Bibliotheek – best-practice CSS
config.rb – om te delen met collega's
GEREEDSCHAPSKIST
compass watch – schrijft CSS terwijl u SASSt
compass create – begin een nieuw project
Image sprites genereren – volautomatisch
BIBLIOTHEEK
Wie weet uit z'n hoofd hoe je een CSS3 background gradient maakt?
.gradient {
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0
background-image: -webkit-linear-gradient(#ffffff, #aaaaaa);
background-image: -moz-linear-gradient(#ffffff, #aaaaaa);
background-image: -o-linear-gradient(#ffffff, #aaaaaa);
background-image: linear-gradient(#ffffff, #aaaaaa);
}
.gradient {
@include background-image(linear-gradient(#ffffff, #aaaaaa));
}
CONFIG.RB
css_dir = "stylesheets"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "javascripts"
DE 2e GENERATIE CSS GRID SYSTEMS
...EN IN HET BIJZONDER SUSY
Semantisch
SASS & Compass
Flexibel
GRID SYSTEM: WAAROM EIGENLIJK?
Grafisch ontwerp – nauwkeurige implementatie
Schetsen / ontwerpen in de browser – gemak & snelheid
DRY – developers zijn lui
Onderhouden en uitbreiden – consistentie
NIET-SEMANTISCH GRID SYSTEM
<div id="main" class="container_12">
<article class="grid_8 prefix_4">
Lorem ipsum, dolor sit amet.
</article>
</div>
.container_12 {
width: 960px;
}
.grid_8 {
display: inline;
float: left;
margin-left: 10px;
margin-right: 10px;
}
.container_12 .prefix_4 {
padding-left: 320px;
}
.container_12 .grid_8 {
width: 620px;
}
SEMANTISCH GRID SYSTEM (SUSY)
<div id="main">
<article>
Lorem ipsum, dolor sit amet.
</article>
</div>
#main {
@include container;
}
#main article {
@include span-columns(8);
@include prefix(4);
}
SASS & COMPASS DO THE MATH
$total-columns : 4;
$total-columns-m : 6;
$total-columns-l : 8;
$column-width : 8em;
$gutter-width : 2em;
$grid-padding : $gutter-width / 2;
#page {
@include container($total-columns,
$total-columns-m,
$total-columns-l);
}
#page {
max-width: 40em;
padding-left: 1em;
padding-right: 1em;
margin-left: auto;
margin-right: auto;
}
#page:after {
content: "";
display: table;
clear: both;
}
@media (min-width: 60em) {
#page {
max-width: 60em;
}
}
@media (min-width: 80em) {
#page {
max-width: 80em;
}
}
COMBINEREN TOT EEN DRUPAL THEME
LEES: AURORA INSTALLEREN
“Aurora is an HTML5, Sass and Compass powered, responsive
optimized, mobile first base theme designed for people who like
theming through code as opposed to through a GUI.”
AURORA: BASE THEME
drush dl aurora
drush en aurora -y
AURORA: RUBY GEM
gem install compass-aurora
AURORA: SUB THEME
compass create -r aurora --using aurora/corona
AURORA: DON'T CLICK!
Uit de .info file:
...
; Chrome Frame Options
settings[aurora_enable_chrome_frame] = 1
settings[aurora_min_ie_support] = 10
; Miscelaneous Options
settings[aurora_remove_core_css] = 0
settings[aurora_html_tags] = 1
settings[aurora_typekit_id] = 0
; JavaScript Options
settings[aurora_footer_js] = 1
settings[aurora_libraries_head] = 0
...
DE GROTE GEVAARLIJKE ONVERMIJDELIJKE
LIVE DEMO
DOET U DEZE MAAR

Más contenido relacionado

Similar a Drupal theming met sass, compass, susy en aurora

Drupal Theming with CSS Frameworks (960grid)
Drupal Theming with CSS Frameworks (960grid)Drupal Theming with CSS Frameworks (960grid)
Drupal Theming with CSS Frameworks (960grid)
Ryan Cross
 

Similar a Drupal theming met sass, compass, susy en aurora (20)

CSS vs. JavaScript - Trust vs. Control
CSS vs. JavaScript - Trust vs. ControlCSS vs. JavaScript - Trust vs. Control
CSS vs. JavaScript - Trust vs. Control
 
Drupal 960 grid system based theming
Drupal 960 grid system based theming Drupal 960 grid system based theming
Drupal 960 grid system based theming
 
Sweet and Sassy Responsive Design
Sweet and Sassy Responsive DesignSweet and Sassy Responsive Design
Sweet and Sassy Responsive Design
 
Refresh OKC
Refresh OKCRefresh OKC
Refresh OKC
 
Drupal Theming with CSS Frameworks (960grid)
Drupal Theming with CSS Frameworks (960grid)Drupal Theming with CSS Frameworks (960grid)
Drupal Theming with CSS Frameworks (960grid)
 
Sass: Introduction
Sass: IntroductionSass: Introduction
Sass: Introduction
 
Understanding sass
Understanding sassUnderstanding sass
Understanding sass
 
CSS3: The Next Generation Of Style
CSS3: The Next Generation Of StyleCSS3: The Next Generation Of Style
CSS3: The Next Generation Of Style
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, Greensock
 
Beginning CSS.
Beginning CSS.Beginning CSS.
Beginning CSS.
 
Not Just a Pretty Face: How to design and build a cross-CMS CSS framework
Not Just a Pretty Face: How to design and build a cross-CMS CSS frameworkNot Just a Pretty Face: How to design and build a cross-CMS CSS framework
Not Just a Pretty Face: How to design and build a cross-CMS CSS framework
 
ResponsiveWebDesign
ResponsiveWebDesignResponsiveWebDesign
ResponsiveWebDesign
 
Graphic Design For Web
Graphic Design For WebGraphic Design For Web
Graphic Design For Web
 
Magento RWD is Awesome
Magento RWD is AwesomeMagento RWD is Awesome
Magento RWD is Awesome
 
Magento RWD is Awesome
Magento RWD is AwesomeMagento RWD is Awesome
Magento RWD is Awesome
 
RESPONSIVE_WEB_DESIGNRESPONSIVE_WEB_DESIGN
RESPONSIVE_WEB_DESIGNRESPONSIVE_WEB_DESIGNRESPONSIVE_WEB_DESIGNRESPONSIVE_WEB_DESIGN
RESPONSIVE_WEB_DESIGNRESPONSIVE_WEB_DESIGN
 
Mobile and Responsive Design with Sass
Mobile and Responsive Design with SassMobile and Responsive Design with Sass
Mobile and Responsive Design with Sass
 
Hardboiled Front End Development — Found.ation
Hardboiled Front End Development — Found.ationHardboiled Front End Development — Found.ation
Hardboiled Front End Development — Found.ation
 

Más de Triquanta

Más de Triquanta (6)

Showcase Joost DrupalCon Vienna
Showcase Joost DrupalCon ViennaShowcase Joost DrupalCon Vienna
Showcase Joost DrupalCon Vienna
 
Entities in Drupal 8 - Drupal Tech Talk - Bart Feenstra
Entities in Drupal 8 - Drupal Tech Talk - Bart FeenstraEntities in Drupal 8 - Drupal Tech Talk - Bart Feenstra
Entities in Drupal 8 - Drupal Tech Talk - Bart Feenstra
 
Hoe CMI in Drupal features overbodig maakt (of toch niet) - Drupal Tech Talk ...
Hoe CMI in Drupal features overbodig maakt (of toch niet) - Drupal Tech Talk ...Hoe CMI in Drupal features overbodig maakt (of toch niet) - Drupal Tech Talk ...
Hoe CMI in Drupal features overbodig maakt (of toch niet) - Drupal Tech Talk ...
 
The backend-of-frontend Drupaljam 2014
The backend-of-frontend Drupaljam 2014The backend-of-frontend Drupaljam 2014
The backend-of-frontend Drupaljam 2014
 
Toegankelijke Data
Toegankelijke DataToegankelijke Data
Toegankelijke Data
 
Van adlib naar online collectie
Van adlib naar online collectieVan adlib naar online collectie
Van adlib naar online collectie
 

Último

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Último (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
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
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

Drupal theming met sass, compass, susy en aurora

  • 1. RESPONSIVE DRUPAL THEMING MET SASS, COMPASS, SUSY EN AURORA DRUPAL TECH TALK 25 APRIL 2013 MARC VAN GEND TRIQUANTA
  • 2. AGENDA Het Doel – #responsivemobilefirsthtml5buzzwordcompliant CSS preprocessing – SASS Werken met SASS – Compass De 2e generatie CSS grid systems – Susy Combineren tot een Drupal theme – Aurora De grote gevaarlijke onvermijdelijke live demo – or it didn't happen
  • 3. HET DOEL #RESPONSIVEMOBILEFIRSTHTML5BUZZWORDCOMPLIANT Responsive – één site voor alle schermen Progressive enhancement – functioneel » fraai » funky Mobile first – eerst simpel, dan groeien HTML5 – is beter, kan meer Werkbaar – samenwerken, onderhouden, uitbreiden
  • 4. CSS PREPROCESSING EN WAT IS SASS EIGENLIJK? SASS: “programmeren met stylesheets” .scss syntax: superset van CSS variables nesting mixins
  • 5. SASS: VARIABLES $triquanta-blue: #00c2ff; $gutter: 16px; .quote { margin: $gutter; padding: $gutter / 2; color: $triquanta-blue; } .quote { margin: 16px; padding: 8px; color: #00c2ff; }
  • 6. SASS: NESTING .menu li { float: left; a { color: #cc0000; } } .menu li { float: left; } .menu li a { color: #cc0000; }
  • 7. SASS: MIXINS @mixin box($color, $border:true) { padding: 1em; background-color: $color; @if $border { border: 1px solid #000000; } } .node { @include box(#006600); } .quote { @include box(#333333, false); } .node { padding: 1em; background-color: #006600; border: 1px solid #000000; } .quote { padding: 1em; background: #333333; }
  • 8. COMPASS ZET SASS AAN HET WERK Gereedschapskist – doet niet de afwas Bibliotheek – best-practice CSS config.rb – om te delen met collega's
  • 9. GEREEDSCHAPSKIST compass watch – schrijft CSS terwijl u SASSt compass create – begin een nieuw project Image sprites genereren – volautomatisch
  • 10. BIBLIOTHEEK Wie weet uit z'n hoofd hoe je een CSS3 background gradient maakt? .gradient { background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0 background-image: -webkit-linear-gradient(#ffffff, #aaaaaa); background-image: -moz-linear-gradient(#ffffff, #aaaaaa); background-image: -o-linear-gradient(#ffffff, #aaaaaa); background-image: linear-gradient(#ffffff, #aaaaaa); } .gradient { @include background-image(linear-gradient(#ffffff, #aaaaaa)); }
  • 11. CONFIG.RB css_dir = "stylesheets" sass_dir = "sass" images_dir = "images" javascripts_dir = "javascripts"
  • 12. DE 2e GENERATIE CSS GRID SYSTEMS ...EN IN HET BIJZONDER SUSY Semantisch SASS & Compass Flexibel
  • 13. GRID SYSTEM: WAAROM EIGENLIJK? Grafisch ontwerp – nauwkeurige implementatie Schetsen / ontwerpen in de browser – gemak & snelheid DRY – developers zijn lui Onderhouden en uitbreiden – consistentie
  • 14. NIET-SEMANTISCH GRID SYSTEM <div id="main" class="container_12"> <article class="grid_8 prefix_4"> Lorem ipsum, dolor sit amet. </article> </div> .container_12 { width: 960px; } .grid_8 { display: inline; float: left; margin-left: 10px; margin-right: 10px; } .container_12 .prefix_4 { padding-left: 320px; } .container_12 .grid_8 { width: 620px; }
  • 15. SEMANTISCH GRID SYSTEM (SUSY) <div id="main"> <article> Lorem ipsum, dolor sit amet. </article> </div> #main { @include container; } #main article { @include span-columns(8); @include prefix(4); }
  • 16. SASS & COMPASS DO THE MATH $total-columns : 4; $total-columns-m : 6; $total-columns-l : 8; $column-width : 8em; $gutter-width : 2em; $grid-padding : $gutter-width / 2; #page { @include container($total-columns, $total-columns-m, $total-columns-l); } #page { max-width: 40em; padding-left: 1em; padding-right: 1em; margin-left: auto; margin-right: auto; } #page:after { content: ""; display: table; clear: both; } @media (min-width: 60em) { #page { max-width: 60em; } } @media (min-width: 80em) { #page { max-width: 80em; } }
  • 17. COMBINEREN TOT EEN DRUPAL THEME LEES: AURORA INSTALLEREN “Aurora is an HTML5, Sass and Compass powered, responsive optimized, mobile first base theme designed for people who like theming through code as opposed to through a GUI.”
  • 18. AURORA: BASE THEME drush dl aurora drush en aurora -y
  • 19. AURORA: RUBY GEM gem install compass-aurora
  • 20. AURORA: SUB THEME compass create -r aurora --using aurora/corona
  • 21. AURORA: DON'T CLICK! Uit de .info file: ... ; Chrome Frame Options settings[aurora_enable_chrome_frame] = 1 settings[aurora_min_ie_support] = 10 ; Miscelaneous Options settings[aurora_remove_core_css] = 0 settings[aurora_html_tags] = 1 settings[aurora_typekit_id] = 0 ; JavaScript Options settings[aurora_footer_js] = 1 settings[aurora_libraries_head] = 0 ...
  • 22. DE GROTE GEVAARLIJKE ONVERMIJDELIJKE LIVE DEMO
  • 23. DOET U DEZE MAAR