sassy stylesheets with scss

53
S! S w SCSS Kr R @r This work is licensed under http://creativecommons.org/licenses/by-nc-sa/3.0 Saturday, September 14, 13

Upload: kathryn-rotondo

Post on 06-May-2015

686 views

Category:

Technology


1 download

DESCRIPTION

If you've ever wished for more readable and maintainable CSS, SCSS (the current version of Sass) is the tool you've been waiting for. SCSS builds upon CSS3 to add features such as reusable variables and blocks, functions for manipulating colors and doing mathematical operations, selector nesting, and style inheritance. Before deploying, you simply compile your SCSS into ordinary CSS files in one easy (and easily automated) step. This session will present the core features of SCSS with helpful examples, and get you excited about writing CSS again.

TRANSCRIPT

Page 1: Sassy Stylesheets with SCSS

S!"#!S$#%&'(($" w)$' SCSS

K*$'r#+ R,$,+-,@.r,$,+-,

This work is licensed under http://creativecommons.org/licenses/by-nc-sa/3.0

Saturday, September 14, 13

Page 2: Sassy Stylesheets with SCSS

W'*$ / SCSS?

Saturday, September 14, 13

Page 3: Sassy Stylesheets with SCSS

S0SSsass-lang.com/

Saturday, September 14, 13

Page 4: Sassy Stylesheets with SCSS

SCSS:S!"# CSS

Saturday, September 14, 13

Page 5: Sassy Stylesheets with SCSS

0 "1p(r"($,f CSS3

Saturday, September 14, 13

Page 6: Sassy Stylesheets with SCSS

F(*$1r&V*r)*b%&

M2)+"F1+3$),+"N&$)+4

I+'(r)$*+3(Saturday, September 14, 13

Page 7: Sassy Stylesheets with SCSS

CSS pr(-pr,3&",r

Saturday, September 14, 13

Page 8: Sassy Stylesheets with SCSS

"$#%(."3""

"$#%(.3""Saturday, September 14, 13

Page 9: Sassy Stylesheets with SCSS

G($$)+4S$*r$(-

Saturday, September 14, 13

Page 11: Sassy Stylesheets with SCSS

H*55(rhammerformac.com

Saturday, September 14, 13

Page 12: Sassy Stylesheets with SCSS

R(*-# $, C,-(!

Saturday, September 14, 13

Page 13: Sassy Stylesheets with SCSS

V*r)*b%&3,+"$*+$"

Saturday, September 14, 13

Page 14: Sassy Stylesheets with SCSS

D(3%*r( V*r"

$blue: #3bbfce; $margin: 16px;

Saturday, September 14, 13

Page 15: Sassy Stylesheets with SCSS

U"( V*r".border { color: $blue; margin:$margin;}

Saturday, September 14, 13

Page 16: Sassy Stylesheets with SCSS

N15b(r"1.213

10px

Saturday, September 14, 13

Page 17: Sassy Stylesheets with SCSS

S$r)+4"“foo”‘bar’baz

Saturday, September 14, 13

Page 18: Sassy Stylesheets with SCSS

C,%,r"blue

#04a3f9

Saturday, September 14, 13

Page 19: Sassy Stylesheets with SCSS

B,,%(*+"truefalse

Saturday, September 14, 13

Page 20: Sassy Stylesheets with SCSS

+1%%"null

Saturday, September 14, 13

Page 21: Sassy Stylesheets with SCSS

L/$"1.5em 1em 0 2emHelvetica, Arial, ...

Saturday, September 14, 13

Page 22: Sassy Stylesheets with SCSS

M2)+"r(1"*b%( 3,-(

b%,3."

Saturday, September 14, 13

Page 23: Sassy Stylesheets with SCSS

D(3%*r( M2)+@mixin centered { display:block; margin-le!:auto; margin-right:auto;}

Saturday, September 14, 13

Page 24: Sassy Stylesheets with SCSS

U"( M2)+img { @include: centered;}

Saturday, September 14, 13

Page 25: Sassy Stylesheets with SCSS

V(+-,r Pr(6@mixin border-radius { -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px;}

Saturday, September 14, 13

Page 26: Sassy Stylesheets with SCSS

V(+-,r Pr(6@mixin border-radius { -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px;}

Saturday, September 14, 13

Page 27: Sassy Stylesheets with SCSS

B($$(r...@mixin border-radius { $radius: 5px; -moz-border-radius: $radius; -webkit-border-radius: $radius; border-radius: $radius;}

Saturday, September 14, 13

Page 28: Sassy Stylesheets with SCSS

0r415(+$"@mixin border-radius ($radius) { -moz-border-radius: $radius; -webkit-border-radius: $radius; border-radius: $radius;}

Saturday, September 14, 13

Page 29: Sassy Stylesheets with SCSS

U")+4 0r4"img { @include border-radius(20px);}

Saturday, September 14, 13

Page 30: Sassy Stylesheets with SCSS

0r4 D(f*1%$"@mixin border-radius ($rad: 5px) { -moz-border-radius: $rad; -webkit-border-radius: $rad; border-radius: $rad;}

Saturday, September 14, 13

Page 31: Sassy Stylesheets with SCSS

U")+4 D(f*1%$"img { @include border-radius;}

Saturday, September 14, 13

Page 32: Sassy Stylesheets with SCSS

S)5p%)3)$#@mixin drop-shadow ($args) { -webkit-filter: drop-shadow($args); -moz-filter: drop-shadow($args); -ms-filter: drop-shadow ($args); -o-filter: drop-shadow ($args); filter: drop-shadow ($args);}

Saturday, September 14, 13

Page 33: Sassy Stylesheets with SCSS

R(*-*b)%)$#@mixin box-shadow ( $h-shadow, $v-shadow, $blur, $color) { -moz-box-shadow: $h-shadow $v-shadow $blur $color; -webkit-box-shadow: $h-shadow $v-shadow $blur $color; box-shadow: $h-shadow $v-shadow $blur $color;}

Saturday, September 14, 13

Page 34: Sassy Stylesheets with SCSS

F1+3$),+"3,%,r", 5*$',

& 5,r(

Saturday, September 14, 13

Page 35: Sassy Stylesheets with SCSS

C,%,r F1+3$),+"rgb, rgba/hsl, hslalighten/darkencomplement, invertopacify, transparentize ... & !"r#!

Saturday, September 14, 13

Page 36: Sassy Stylesheets with SCSS

C,%,r F1+3$),+"rgb, rgba/hsl, hslalighten/darkencomplement, invertopacify, transparentize ... & !"r#!

Saturday, September 14, 13

Page 37: Sassy Stylesheets with SCSS

C,%,r F1+3$),+"rgb, rgba/hsl, hslalighten/darkencomplement, invertopacify, transparentize ... & !"r#!

Saturday, September 14, 13

Page 38: Sassy Stylesheets with SCSS

C,%,r F1+3$),+"rgb, rgba/hsl, hslalighten/darkencomplement, invertopacify, transparentize ... & !"r#!

Saturday, September 14, 13

Page 39: Sassy Stylesheets with SCSS

C,%,r F1+3$),+"rgb, rgba/hsl, hslalighten/darkencomplement, invertopacify, transparentize ... & !"r#!

Saturday, September 14, 13

Page 40: Sassy Stylesheets with SCSS

F1+3$),+ U"(h1 { color:lighten($main-color, 20%);}

h2 { color:complement($main-color);}

Saturday, September 14, 13

Page 41: Sassy Stylesheets with SCSS

B!)3 M*$'.border { margin:$margin; padding: $margin/2;}

Saturday, September 14, 13

Page 42: Sassy Stylesheets with SCSS

M*$' F1+3$),+" percentage round, ceil, floor min, max abs

Saturday, September 14, 13

Page 44: Sassy Stylesheets with SCSS

N&$)+4.((p %).( w)$' %).(

Saturday, September 14, 13

Page 45: Sassy Stylesheets with SCSS

B(f,r(a { color: $link-color;}

a:hover { color: $link-hover-color;}

Saturday, September 14, 13

Page 46: Sassy Stylesheets with SCSS

N&$)+4a { color: $link-color;

&:hover { color: $link-hover-color; }}

Saturday, September 14, 13

Page 47: Sassy Stylesheets with SCSS

M,r( N&$)+4#nav { a { color:$nav-color; &:hover { color: $nav-hover-color; } }}

Saturday, September 14, 13

Page 48: Sassy Stylesheets with SCSS

I+'(r)$*+3(*v,)- -1p%)3*$),+

Saturday, September 14, 13

Page 49: Sassy Stylesheets with SCSS

I+'(r)$*+3( .error { background: #fdd; }

.badError { @extend .error; border-width: 3px; }

Saturday, September 14, 13

Page 50: Sassy Stylesheets with SCSS

C,55(+$"// 4($ r(5,v(-

/* "$*# *r,1+- */

Saturday, September 14, 13

Page 51: Sassy Stylesheets with SCSS

B,1rb,+1 )%!p+# .(, +%0*&w#%0*& !2%( +%br.r- f"r S/).

bourbon.io

Saturday, September 14, 13

Page 52: Sassy Stylesheets with SCSS

B"'rb"( N#.&1 +%0*&w#%0*& )#!.(&%$ 0r%,

fr.!#w"r3 f"r S/) .(, B"'rb"(.

neat.bourbon.io/

Saturday, September 14, 13

Page 53: Sassy Stylesheets with SCSS

D*+.!K*$'r#+ R,$,+-,

kathrynrotondo.com@krotondo

This work is licensed under http://creativecommons.org/licenses/by-nc-sa/3.0

Saturday, September 14, 13