JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
stylus: wfpl_culumns: fix outer_width scaling
[wfpl.git] / stylus_helpers.styl
index d885abe..f8db4bf 100644 (file)
@@ -150,7 +150,14 @@ sprites(image, height, count, v_offset = 0, h_offset = 0)
                        y = - (@height * n) - unit(v_offset, px)
                        background-position: (0 - unit(h_offset, px)) y
 sprite(image, height, v_offset = 0, h_offset = 0)
-       sprites(image, height, 1, v_offset, h_offset)
+       height: unit(height, px)
+       if image[1]
+               background: url(image[0])
+               background: url(image[1]), linear-gradient(transparent, transparent);
+       else
+               background-image: url(image)
+       background-repeat: no-repeat;
+       background-position: (0 - unit(h_offset, px)) (0 - unit(v_offset, px))
 
 // Styling for a variable height element with an image background where the
 // middle repeats vertically. You must split your image into three images, and
@@ -389,8 +396,8 @@ wfpl_columns_helper(top, node, selector, parent_width, expected_width)
                unless parent_width // should only happen at top level
                        parent_width = outer_width
                top['css'][selector] = css_rules
-               for k, v in node
-                       if k != 'outer_width' && k != 'border-width' && k != 'border-left-width' && k != 'border-right-width'
+               for k, v in css_rules
+                       if k != 'border-width' && k != 'border-left-width' && k != 'border-right-width'
                                if typeof(v) == 'unit' && unit(v) == 'px'
                                        responsive_css_rules[k] = floor(unit((v / parent_width) * 100, '%'), 4)
                top['responsive_css'][selector] = responsive_css_rules