Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Commit

Permalink
Revert "Let pad mixin accept null to skip a side"
Browse files Browse the repository at this point in the history
This reverts commit 22b451f.

Unfortely, now that bourbon is no longer a dependancy, this chage no longer
functions. If this functionality is required for your project, use bourbon and
import the `padding()` mixin.
  • Loading branch information
whmii committed Jul 7, 2016
1 parent 22b451f commit e9b3f36
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 55 deletions.
8 changes: 4 additions & 4 deletions app/assets/stylesheets/grid/_pad.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// Adds padding to the element.
///
/// @param {List} $padding [flex-gutter()]
/// A list of padding value(s) to use. Passing `default` in the list will result in using the gutter width as a padding value. Use a `null` value to “skip” a side.
/// A list of padding value(s) to use. Passing `default` in the list will result in using the gutter width as a padding value.
///
/// @example scss - Usage
/// .element {
Expand All @@ -16,10 +16,10 @@
/// }
@mixin pad($padding: flex-gutter()) {
$vals: ();
$padding-list: null;
@each $value in $padding {
$value: if($value == 'default', flex-gutter(), $value);
$vals: append($vals, $value);
$padding-list: join($padding-list, $value);
}
@include directional-property(padding, false, $vals);
padding: $padding-list;
}
24 changes: 1 addition & 23 deletions spec/neat/pad_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,7 @@

context "with argument (default)" do
it "uses default gutter percentage" do
expect(".pad-shorthand-default").to have_rule("padding: 30px 2.35765% 10px")
end
end

context "with argument (null)" do
it "ignores rules with null values" do
ruleset = "padding-right: 10px; " +
"padding-left: 10px;"
bad_rule = "padding-top: null;"

expect(".pad-null-values").to have_ruleset(ruleset)
expect(".pad-null-values").to_not have_rule(bad_rule)
end
end

context "with argument (null default)" do
it "sets right and left paddings to gutter percentage" do
ruleset = "padding-right: 2.35765%; " +
"padding-left: 2.35765%;"
bad_rule = "padding-top: null;"

expect(".pad-null-and-default").to have_ruleset(ruleset)
expect(".pad-null-and-default").to_not have_rule(bad_rule)
expect(".pad-shorthand-default").to have_rule("padding: 30px 2.35765% 10px 2.35765%")
end
end
end
Expand Down
20 changes: 0 additions & 20 deletions spec/support/matchers/have_ruleset.rb

This file was deleted.

8 changes: 0 additions & 8 deletions test/pad.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,3 @@
.pad-shorthand-default {
@include pad(30px default 10px default);
}

.pad-null-values {
@include pad(null 10px null 10px);
}

.pad-null-and-default {
@include pad(null default);
}

0 comments on commit e9b3f36

Please sign in to comment.