A presentation by @ldn_tech_exec for #magentoLDN on extreme CSS techniques, how to set up codekit, compass and sass/scss and the skeleton responsive/adaptive framework for Magento
source code:
https://github.com/arush/mage-skeleton
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