– and –
LEAVING PROBLEMS WHERE THEY BELONG
LESS, SASS, and Stylus
Twitter built bootstrap with it, so it can't be that bad right?
@base: #f938ab;
.box-shadow(@style, @c) when (iscolor(@c)) {
-webkit-box-shadow: @style @c;
box-shadow: @style @c;
}
.box-shadow(@style, @alpha: 50%) when (isnumber(@alpha)) {
.box-shadow(@style, rgba(0, 0, 0, @alpha));
}
.box {
color: saturate(@base, 5%);
border-color: lighten(@base, 30%);
div { .box-shadow(0 0 5px, 30%) }
}It's built on Ruby. Everyone uses Ruby.
(I don't...I did.)
@mixin border-radius($radius) {
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
-ms-border-radius: $radius;
border-radius: $radius;
}
.box { @include border-radius(10px); }.scss
=border-radius($radius)
-webkit-border-radius: $radius
-moz-border-radius: $radius
-ms-border-radius: $radius
border-radius: $radius
.box
+border-radius(10px).sass
TJ Holowaychuck wrote it, it must be good.
border-radius()
-webkit-border-radius arguments
-moz-border-radius arguments
border-radius arguments
body
font 12px Helvetica, Arial, sans-serif
a.button
border-radius 5pxThe path that got us here
There are people smarter than you
You probably haven't found the right tool yet
Finding the problems
...or the chopping block
@include border-radius(5px)yet 90% of browsers support the unprefixed:
SASS asks me to write:
border-radius: 5px;If my measure of success was typing less (ha. ha.), then this works:
.border-radius(5px)...but none of these felt right.
Browser Prefixing
.foo
border-radius: 5px.foo{
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px;
}
...there's a transparent mixin here as well.
Transparent Mixins
.bar
fixed: top left
color: red.bar{
position: fixed;
top: 0;
left: 0;
color: red;
}
Instead of...
.bar{
@include fixed-positioning(top, left);
color: red;
}It's really good looking
* + *
margin-top $baseLineHeight
body
font-family $bodyFont
font-size $bodyFontSize
line-height $baseLineHeight
color $baseFontColor
margin 40pxclass Coffee extends Beans
initialize: ->
console.log 'Brewing...'especially if you're used to writing coffeescript
had me at 'Hello' (World)
Sometime around the release of CSS5 ;)
It's fragile. Take care of it, and don't litter
is not where we are now
and there's no wrench?
JUSTJAVASCRIPT™
BEM [block, element, modifier]
MODULES [no seriously. modules.]
Plus...you don't have a choice
are BY DESIGN....eek.
specificity wars
indeterminate selectors
inconsistent implementations
half-implemented specifications
etc...
you must live with what you have
It may not have been clear, but it is now
THE LONELY CREW


Building beautiful stuff,
for freaking ever.
Bourbon,
Neat,
Bitters,
Refills.
So many options that there's a tool for finding all of the great stuff. (Sache)
A really strong core
Jeet (Grid), Rupture (Responsive Design) and Axis (Bootstrap-like) are additional tools that may help those coming from a large library like Compass, feel at home.
@import 'nib'It's not so bad.
and it all moves REALLY fast
Want to know what all I'm fussing about?
nick@bolsterlabs.com