SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
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

Contenu connexe

Similaire à Drupal theming met sass, compass, susy en aurora

CSS vs. JavaScript - Trust vs. Control
CSS vs. JavaScript - Trust vs. ControlCSS vs. JavaScript - Trust vs. Control
CSS vs. JavaScript - Trust vs. ControlChristian Heilmann
 
Drupal 960 grid system based theming
Drupal 960 grid system based theming Drupal 960 grid system based theming
Drupal 960 grid system based theming Gaurav Mishra
 
Sweet and Sassy Responsive Design
Sweet and Sassy Responsive DesignSweet and Sassy Responsive Design
Sweet and Sassy Responsive DesignMina Markham
 
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
 
CSS3: The Next Generation Of Style
CSS3: The Next Generation Of StyleCSS3: The Next Generation Of Style
CSS3: The Next Generation Of StylejbellWCT
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3Doris Chen
 
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}}Eric Carlisle
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockMarco Pinheiro
 
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 frameworkcrystalenka
 
Graphic Design For Web
Graphic Design For WebGraphic Design For Web
Graphic Design For WebDeniz Gökçe
 
RESPONSIVE_WEB_DESIGNRESPONSIVE_WEB_DESIGN
RESPONSIVE_WEB_DESIGNRESPONSIVE_WEB_DESIGNRESPONSIVE_WEB_DESIGNRESPONSIVE_WEB_DESIGN
RESPONSIVE_WEB_DESIGNRESPONSIVE_WEB_DESIGNDaveEstonilo
 
Mobile and Responsive Design with Sass
Mobile and Responsive Design with SassMobile and Responsive Design with Sass
Mobile and Responsive Design with Sassnyccamp
 
Hardboiled Front End Development — Found.ation
Hardboiled Front End Development — Found.ationHardboiled Front End Development — Found.ation
Hardboiled Front End Development — Found.ationSpiros Martzoukos
 

Similaire à 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
 

Plus de Triquanta

Showcase Joost DrupalCon Vienna
Showcase Joost DrupalCon ViennaShowcase Joost DrupalCon Vienna
Showcase Joost DrupalCon ViennaTriquanta
 
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 FeenstraTriquanta
 
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 ...Triquanta
 
The backend-of-frontend Drupaljam 2014
The backend-of-frontend Drupaljam 2014The backend-of-frontend Drupaljam 2014
The backend-of-frontend Drupaljam 2014Triquanta
 
Toegankelijke Data
Toegankelijke DataToegankelijke Data
Toegankelijke DataTriquanta
 
Van adlib naar online collectie
Van adlib naar online collectieVan adlib naar online collectie
Van adlib naar online collectieTriquanta
 

Plus 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
 

Dernier

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
🐬 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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
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 WoodJuan lago vázquez
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
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 Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Dernier (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
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 Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

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