Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added info on lists and extending sass with ruby

  • Loading branch information...
commit a7af4538bbf13519dfec1865daee0612faeb03cc 1 parent 72bbbdb
@scottdavis scottdavis authored
Showing with 73 additions and 0 deletions.
  1. +1 −0  Gemfile
  2. +7 −0 Gemfile.lock
  3. +65 −0 presentation/02_sass.slides
View
1  Gemfile
@@ -2,4 +2,5 @@ source :rubygems
gem 'sinatra', '~> 1.3.2'
gem 'attentive', :path => '../attentive'
+gem 'thin'
View
7 Gemfile.lock
@@ -61,7 +61,9 @@ GEM
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
+ daemons (1.1.8)
erubis (2.7.0)
+ eventmachine (0.12.10)
execjs (1.3.0)
multi_json (~> 1.0)
ffi (1.0.11)
@@ -126,6 +128,10 @@ GEM
sprockets (~> 2.0)
tilt (~> 1.1)
sprockets-vendor_gems (0.1.1)
+ thin (1.3.1)
+ daemons (>= 1.0.9)
+ eventmachine (>= 0.12.6)
+ rack (>= 1.0.0)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
@@ -139,3 +145,4 @@ PLATFORMS
DEPENDENCIES
attentive!
sinatra (~> 1.3.2)
+ thin
View
65 presentation/02_sass.slides
@@ -25,6 +25,43 @@
```
+!SLIDE
+
+# Lists
+
+``` css
+ border : 1px solid black;
+```
+
+!SLIDE
+
+``` scss
+ $my-list : 1px solid black;
+ $my-list2 : 1px, solid, black;
+ $my-list3 : (1px solid black);
+
+ border : $my-list;
+
+```
+
+!SLIDE
+
+# In ruby
+
+``` ruby
+ Sass::Script::List.new(['1px', 'solid', 'black'], ',')
+```
+
+!SLIDE
+## List Functions
+
+* `length($list)`
+* `nth($list, $n)`
+* `join($list1, $list2, [$separator])`
+* More coming soon!
+
+
+
!SLIDE mixins
# Functions and Mixins
@@ -84,3 +121,31 @@ a:hover { color : red; }
}
```
+
+!SLIDE
+## Extending with ruby
+
+``` ruby
+def sprite(map, sprite, offset_x = ZERO, offset_y = ZERO)
+ sprite = convert_sprite_name(sprite)
+ verify_map(map)
+ unless sprite.is_a?(Sass::Script::String)
+ raise Sass::SyntaxError
+ end
+ url = sprite_url(map)
+ position = sprite_position(map, sprite, offset_x, offset_y)
+ Sass::Script::List.new([url] + position.value, :space)
+end
+Sass::Script::Functions.declare :sprite, [:map, :sprite]
+Sass::Script::Functions.declare :sprite, [:map, :sprite, :offset_x]
+Sass::Script::Functions.declare :sprite, [:map, :sprite, :offset_x, :offset_y]
+```
+
+!SLIDE
+## Data types
+
+ * Bool
+ * Color
+ * List
+ * Number
+ * String
Please sign in to comment.
Something went wrong with that request. Please try again.