Permalink
Browse files

Use the last step value as default

  • Loading branch information...
1 parent 9167fe7 commit a896168fe01191661892c2fa325b84467b8b4ca2 @jede committed Mar 30, 2012
Showing with 5 additions and 4 deletions.
  1. +4 −3 spec/integration/steps_spec.rb
  2. +1 −1 stylesheets/longitude.scss
@@ -3,17 +3,18 @@
describe 'Steps' do
before :each do
@css = render """
- @include longitude(2 4) {
+ @include longitude(2 4 6) {
p { width: steps(10px 20px); }
}
"""
end
it 'sets width according to the given steps' do
@css.should include("width: 10px;")
+ @css.should include("width: 20px;")
end
- it 'sets width according to the given steps' do
- @css.should include("width: 20px;")
+ it 'sets the last value as the default if it is missing' do
+ @css.should match(/@media \(min-width: 481px\).* width: 20px;/m)
end
end
@@ -52,7 +52,7 @@ $longitude-base-width: 100%;
}
@function steps($list){
- @return nth($list, $longitude-column-index);
+ @return nth($list, min($longitude-column-index, length($list)));
}
@mixin longitude($breakpoints) {

0 comments on commit a896168

Please sign in to comment.