SlideShare a Scribd company logo
skeleton x codekit x
        magento
...and the case for separate css/js files

           @ldn_tech_exec
            #magentoLDN
             4 july 2012
skeleton
● base.css
● layout.css
● skeleton.css
skeleton x magento
● base.css
● skeleton.css
● layout.css

●   no-frame.phtml
●   app/code/local/Mage/Page/etc/config.xml
●   app/etc/modules/Mage_All.xml
●   local.xml - add no-frame.phtml to any page
no-frame.phtml
● removed all columns
● viewport
  <meta name="viewport" content="
  width=device-width, initial-
  scale=1.0">
● facebook compatibility
● html IE classes
html IE classes
● the old way (slooow)
  <link href="style.css" rel="stylesheet"
  />
  <!--[if lte IE7]><link href="style.ie7.
  css" rel="stylesheet" /><![endif]-->
● hacks (dangerous and not valid)
  #content { margin: 10px; _margin:20px; }
● the correct way (html5 bp)
  <!--[if lt IE 7]>      <html class="ie ie6
  lte9 lte8 lte7">
allows you to do this
.gte9 .gradient {
   filter: none;
}
divs
<div class="container">
  <div class="one-third column">
    some text
  </div>
  <div class="two-thirds column">
    some two column text
  </div>
</div>
images
<img class="scale-with-grid"
src="..." alt="..." title="..." />
media queries
● always at the bottom
● always in descending order
extreme CSS & JS
   fast landing pages
the case for separate CSS/JS files
● traditional thinking, vs
● fast landing pages

problem: how to manage this? modpagespeed? magento?
locally?
combine CSS files & long expires
gotcha's
● modpagespeed => 4095. what a cunt.
● magento breaks base64

solution
● combine css
  ○ combine locally with CodeKit & BLESS, or
  ○ if you're not scared of 4095, use magento and
    base64.phtml hack
● Aoe JsCssTstamp for long expires
bypass magento base64 bug with base64.
phtml
● layout.xml
<reference name="head">
   <block type="page/html"
   name="bg_css"
   template="page/base64.phtml"/>
</reference>
====
● base64.phtml
<link rel="stylesheet" type="text/css"
href="<?php echo $this->getSkinUrl(); ?
>css/base64.css" media="all">

(better to just combine locally with codekit)
codekit x magento
ever wondered why your scripts get
so damn big?
● old unused CSS and JS generally never get
  deleted, and is hard to manage without
  separating them into files

● use codekit

● e.g. @import "testing-this-layout.css";
codekit, compass & scss
● compass gives you access to a bunch of
  frameworks
● @import
  ○ combine css locally
  ○ anywhere you have reuseable stuff, but want to keep
    files organised (e.g. skeleton, fonts, typography,
    buttons, )
● @include
  ○ where you have @import'd a scss/sass file where
    you have declared a @mixin
  ○ you use @include to call that @mixin
compass example
scss




compiles to
setting up codekit for magento
● create theme "yourtheme-ck"
● mirror magento path names, e.g. "css" and
  "js" etc...
● ...so assets become:
  ○   JS - skin/frontend/default/yourtheme/js
  ○   CSS - skin/frontend/default/yourtheme/css
  ○   IMAGES - skin/frontend/default/yourtheme/images
  ○   SASS - skin/frontend/default/yourtheme/css
● magento structure remains the same
  ○ these compile to "yourtheme/css", "yourtheme/js"
    etc...
  ○ choose "default" as codekit compass project
codekit settings for magento
examples
● landing.css
   ○ @import buttons.scss
   ○ @import typography.scss
   ○ @import forms.scss
   ○ @import header.scss
   ○ @import footer.scss
● styles.css
   ○ @import checkout.scss
   ○ @import cart.scss
   ○ @import widget1.scss
   ○ @import module1.scss
   ○ @import test-module.scss
● change your xml files to reflect landing.css and styles.
  css
resources
@ldn_tech_exec

● github.com/arush
● adding SASS to Sublime Text 2
    ○ http://www.adampatterson.ca/blog/2011/05/adding-
      sass-scss-support-sublime-edit-2/
●   http://incident57.com/codekit/
●   http://www.getskeleton.com/
●   4095 - http://blesscss.com/
●   http://compass-style.org/

More Related Content

PDF
#5 - CSS3 Gradients and Backgrounds
PDF
#6 - Template Engine: Mustache.js
PPTX
Web components. Compose the web.
PDF
JavascriptMVC: Another choice of web framework
PDF
Fecc cg-cb-11.14.17
PDF
Webové aplikace v JavaScriptu
PDF
Basic Web Development | WeiYuan
PDF
JSCS - How to Style your JavaScript Code
#5 - CSS3 Gradients and Backgrounds
#6 - Template Engine: Mustache.js
Web components. Compose the web.
JavascriptMVC: Another choice of web framework
Fecc cg-cb-11.14.17
Webové aplikace v JavaScriptu
Basic Web Development | WeiYuan
JSCS - How to Style your JavaScript Code

What's hot (20)

PDF
Static Websites - The Final Frontier
PDF
Bootstrap 3 + responsive
PDF
Fecrash10:3:17 sd
ODP
Basics of VueJS
PDF
Movable Type 5 : テーマの作成方法
PDF
Bootstrap vs. Skeleton
PDF
Fecc 12517-sd
PPTX
Bootstrap Introduction
PPTX
A beginner's guide to twitter bootstrap
PPTX
Bootstrap 3.1.1
ODP
Drupal Camp Kiev 2012 - High Performance Drupal Web Sites
PDF
3- Learn Flexbox & CSS Grid / Container & items
PDF
Steve Barman - CSS and WordPress
PDF
Introduction to Bootstrap
DOCX
Web design
PDF
1- Learn Flexbox & CSS Grid / Environment setup
PDF
Fronted From Scratch - Supercharge Magento page speed
PDF
2- Learn Flexbox & CSS Grid / Context
PPTX
PPTX
Bootstrap webtech presentation - new
Static Websites - The Final Frontier
Bootstrap 3 + responsive
Fecrash10:3:17 sd
Basics of VueJS
Movable Type 5 : テーマの作成方法
Bootstrap vs. Skeleton
Fecc 12517-sd
Bootstrap Introduction
A beginner's guide to twitter bootstrap
Bootstrap 3.1.1
Drupal Camp Kiev 2012 - High Performance Drupal Web Sites
3- Learn Flexbox & CSS Grid / Container & items
Steve Barman - CSS and WordPress
Introduction to Bootstrap
Web design
1- Learn Flexbox & CSS Grid / Environment setup
Fronted From Scratch - Supercharge Magento page speed
2- Learn Flexbox & CSS Grid / Context
Bootstrap webtech presentation - new
Ad

Viewers also liked (20)

PPTX
14. Общая экономика 2017: Превращение товарного капитала в товарно-торговый к...
PPT
Questionnaire analysis stephen
PPTX
Partnering with Your Members to Strengthen Their Customer Relationships (and ...
PDF
Okanagan college
PDF
59366618 caracterizacion-del-pueblo-awa (1)
ODP
Nodejs Intro - Part2 Introduction to Web Applications
PPT
презентация фотоомоложения
PDF
PRESENTATION - Migrating AWS EBS backed AMI's between Regions
PPT
Retail workshop germany sept 2011 final
PPT
My chosen photo
PPT
2011asperger
PPTX
2 класс. урок №4. привет. считаем до десяти
PPTX
Research into the music video industry pp
PPTX
PPTX
2013 CEO Compensation Study
PPTX
2 класс. урок № 3. привет. в зоопарке
PPTX
2 класс. обощающий урок по разделу привет. повторение
DOCX
Resumo currier radioatidade c
PDF
Dich de hoc v1.1 public
PPTX
The Verbs (simple)
14. Общая экономика 2017: Превращение товарного капитала в товарно-торговый к...
Questionnaire analysis stephen
Partnering with Your Members to Strengthen Their Customer Relationships (and ...
Okanagan college
59366618 caracterizacion-del-pueblo-awa (1)
Nodejs Intro - Part2 Introduction to Web Applications
презентация фотоомоложения
PRESENTATION - Migrating AWS EBS backed AMI's between Regions
Retail workshop germany sept 2011 final
My chosen photo
2011asperger
2 класс. урок №4. привет. считаем до десяти
Research into the music video industry pp
2013 CEO Compensation Study
2 класс. урок № 3. привет. в зоопарке
2 класс. обощающий урок по разделу привет. повторение
Resumo currier radioatidade c
Dich de hoc v1.1 public
The Verbs (simple)
Ad

Similar to Magento x codekit x sass x compass x skeleton responsive grid (20)

PDF
Create a landing page
PDF
Designing for magento
PPTX
Magento 2 theming - knowledge sharing session by suman kc
PDF
Newfangeldy Front End Stuff For People Who Last Touched It Back When Grunge W...
PDF
Death of a Themer
PPT
Death of a Themer - Frontend United - 14 April 2013
KEY
Be German About Your Frontend
PDF
Adaptive theming using compass susy grid
PDF
HTML5 y CSS3
PDF
Magento2 Basics for Frontend Development
PPTX
BDUG Responsive Web Theming - 7/23/12
PDF
Developing Your Ultimate Package
KEY
Sass, Compass
PPTX
Imagine recap-devhub
PDF
CSS Extenders
PPTX
Magento2 frontend development
PDF
How browser engines work?
PDF
From CSS to Sass in WordPress
KEY
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
PPTX
CSS: A Slippery Slope to the Backend
Create a landing page
Designing for magento
Magento 2 theming - knowledge sharing session by suman kc
Newfangeldy Front End Stuff For People Who Last Touched It Back When Grunge W...
Death of a Themer
Death of a Themer - Frontend United - 14 April 2013
Be German About Your Frontend
Adaptive theming using compass susy grid
HTML5 y CSS3
Magento2 Basics for Frontend Development
BDUG Responsive Web Theming - 7/23/12
Developing Your Ultimate Package
Sass, Compass
Imagine recap-devhub
CSS Extenders
Magento2 frontend development
How browser engines work?
From CSS to Sass in WordPress
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
CSS: A Slippery Slope to the Backend

Recently uploaded (20)

PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Cloud computing and distributed systems.
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Big Data Technologies - Introduction.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Spectroscopy.pptx food analysis technology
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
KodekX | Application Modernization Development
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Electronic commerce courselecture one. Pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Cloud computing and distributed systems.
Network Security Unit 5.pdf for BCA BBA.
Big Data Technologies - Introduction.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Understanding_Digital_Forensics_Presentation.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Spectroscopy.pptx food analysis technology
Encapsulation_ Review paper, used for researhc scholars
MYSQL Presentation for SQL database connectivity
Diabetes mellitus diagnosis method based random forest with bat algorithm
KodekX | Application Modernization Development
Unlocking AI with Model Context Protocol (MCP)
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Electronic commerce courselecture one. Pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Empathic Computing: Creating Shared Understanding
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

Magento x codekit x sass x compass x skeleton responsive grid

  • 1. skeleton x codekit x magento ...and the case for separate css/js files @ldn_tech_exec #magentoLDN 4 july 2012
  • 3. skeleton x magento ● base.css ● skeleton.css ● layout.css ● no-frame.phtml ● app/code/local/Mage/Page/etc/config.xml ● app/etc/modules/Mage_All.xml ● local.xml - add no-frame.phtml to any page
  • 4. no-frame.phtml ● removed all columns ● viewport <meta name="viewport" content=" width=device-width, initial- scale=1.0"> ● facebook compatibility ● html IE classes
  • 5. html IE classes ● the old way (slooow) <link href="style.css" rel="stylesheet" /> <!--[if lte IE7]><link href="style.ie7. css" rel="stylesheet" /><![endif]--> ● hacks (dangerous and not valid) #content { margin: 10px; _margin:20px; } ● the correct way (html5 bp) <!--[if lt IE 7]> <html class="ie ie6 lte9 lte8 lte7">
  • 6. allows you to do this .gte9 .gradient { filter: none; }
  • 7. divs <div class="container"> <div class="one-third column"> some text </div> <div class="two-thirds column"> some two column text </div> </div>
  • 9. media queries ● always at the bottom ● always in descending order
  • 10. extreme CSS & JS fast landing pages
  • 11. the case for separate CSS/JS files ● traditional thinking, vs ● fast landing pages problem: how to manage this? modpagespeed? magento? locally?
  • 12. combine CSS files & long expires gotcha's ● modpagespeed => 4095. what a cunt. ● magento breaks base64 solution ● combine css ○ combine locally with CodeKit & BLESS, or ○ if you're not scared of 4095, use magento and base64.phtml hack ● Aoe JsCssTstamp for long expires
  • 13. bypass magento base64 bug with base64. phtml ● layout.xml <reference name="head"> <block type="page/html" name="bg_css" template="page/base64.phtml"/> </reference> ==== ● base64.phtml <link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl(); ? >css/base64.css" media="all"> (better to just combine locally with codekit)
  • 15. ever wondered why your scripts get so damn big? ● old unused CSS and JS generally never get deleted, and is hard to manage without separating them into files ● use codekit ● e.g. @import "testing-this-layout.css";
  • 16. codekit, compass & scss ● compass gives you access to a bunch of frameworks ● @import ○ combine css locally ○ anywhere you have reuseable stuff, but want to keep files organised (e.g. skeleton, fonts, typography, buttons, ) ● @include ○ where you have @import'd a scss/sass file where you have declared a @mixin ○ you use @include to call that @mixin
  • 18. setting up codekit for magento ● create theme "yourtheme-ck" ● mirror magento path names, e.g. "css" and "js" etc... ● ...so assets become: ○ JS - skin/frontend/default/yourtheme/js ○ CSS - skin/frontend/default/yourtheme/css ○ IMAGES - skin/frontend/default/yourtheme/images ○ SASS - skin/frontend/default/yourtheme/css ● magento structure remains the same ○ these compile to "yourtheme/css", "yourtheme/js" etc... ○ choose "default" as codekit compass project
  • 20. examples ● landing.css ○ @import buttons.scss ○ @import typography.scss ○ @import forms.scss ○ @import header.scss ○ @import footer.scss ● styles.css ○ @import checkout.scss ○ @import cart.scss ○ @import widget1.scss ○ @import module1.scss ○ @import test-module.scss ● change your xml files to reflect landing.css and styles. css
  • 21. resources @ldn_tech_exec ● github.com/arush ● adding SASS to Sublime Text 2 ○ http://www.adampatterson.ca/blog/2011/05/adding- sass-scss-support-sublime-edit-2/ ● http://incident57.com/codekit/ ● http://www.getskeleton.com/ ● 4095 - http://blesscss.com/ ● http://compass-style.org/