Foo
Welcome to Foo Corp
Foo Corp is the best, seriously!
Foo bar
- nicole sullivan @stubbornella
it is just CSS, isn't it?
reliable. robust. entertaning.
design. conversion. experience.
fast. reusable. high value.
Foobar
disorientation
divergences
-- repetition --
%separator
border-top: 1px solid black
hr
@extend %separator
.separator
@extend %separator
hr, .separator {
border-top: 1px solid black
}
.block {}
.block__element {}
.block--modifier {}
.element--modifier {}
.block__element--modifier
Foo
use 2 spaces to separate classes
hook-classes:
data attribute:
.widget {
&__title {}
&__body {}
&__network {
&--gplus {}
}
&--social {}
}
variables with BEM:
$price__color--base: #333333 !default;
$price__color--sale: #ff0000 !default;
$price__family: "Helvetica Neue", Helvetica, sans-serif !default;
@mixin getWidget ($hPosition: left, $vPosition: top, $offset: 7%) {
@if $vPosition == top { top: 50px; }
@if $vPosition == middle { top: 100px; }
> div {
@if $hPosition == center {
text-align: center;
} @else {
float: $hPosition;
@media #{$lg-screens} {
margin-#{$hPosition}:$offset;
}
}
}
}
.widget__body {
background: red;
&--left-top {
@include getWidget ();
}
&--left-middle {
@include getWidget ($vPosition: middle);
}
}
You don't get points for being pretty,
you get points for being powerful
- Harry Roberts
http://ianstormtaylor.com/oocss-plus-sass-is-the-best-way-to-css/
https://github.com/stubbornella/oocss/wiki
http://bem.info/
http://www.mathayward.com/modular-css-with-sass-and-bem/
Tobias Hartmann @ToH_82