On Github akdetrick / sassquatch-presentation
*and Sass
I'm Adam Detrick and I work for Meetup
adamd@meetup.com | @akdetrick
... and it's frustrating
Tropical plants that grow on host trees
flickr/edrabbit
flickr/nancybaym
flickr/laughingface
flickr/anitagould
As introduced by Martin Fowler
"... create a new system around the edges of the old, letting it grow slowly until the old system is strangled."
"... you should design [your new application] to make it easier to be strangled in the future."
"Let's face it, all we are doing is writing tomorrow's legacy software today."
"Seed" the top of your cascade with a new CSS foundation
vars, functions, etc.
handles element defaults, typography, etc.
oocss grids, responsive grid system, susy, etc.
simple, standard styling helpers
.leading-top { padding-top: $spacing; }
.ellipsize { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
What happens to legacy CSS?
<div id="mySpecialThing"> <div id="specialThingHeading"> It's special. </div> <div id="specialThingContent"> <span>Really</span> special. </div> </div>
<h2> It's not special. </h2> <p> It just <em>makes sense</em> now. </p>
#mySpecialThing { /* ... bunch o' rules ... */ } #specialThingHeading { /* ... bunch o' rules ... */ } #specialThingContent { /* ... bunch o' rules ... */ } #specialThingContent span { /* ... bunch o' rules ... */ }
/* lol, nope */
design for systems, not for pages
code for systems, not for pages
$headingFontStack: 'Whitney', helvetica, arial, sans-serif; h1,h2,h3,h4,h5,h6 { font-family: $headingFontStack; color: $C_textPrimary; margin: 0; padding: 0; padding-bottom: $baseline/2; line-height: 1.1; font-weight: $W_bold; .inverted & { color: $C_textPrimaryInverted; } }
(we use this as our strangler vine)
<jsp:param name="isModernLayout" value="${true}" />
<c:choose> <c:when test="${not empty param.isModernLayout}"> <c:set var="mainStylesheetPath" value="/style/meetup-modern.css" /> </c:when> <c:otherwise> <c:set var="mainStylesheetPath" value="/style/meetup.css" /> </c:otherwise> </c:choose>
Sassquatch consolidated domain-specific knowledge
github.com/akdetrick/sassquatch-presentation