This repository has been archived by the owner on Jul 14, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 425
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add full width default for
grid-column
on null
`grid-column` now defaults to a full width grid object. This will likely also help avoid people using private functions to retrive grid settings.
- Loading branch information
Showing
6 changed files
with
85 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
} | ||
|
||
.grid__column { | ||
@include grid-column; | ||
@include grid-column(1); | ||
} | ||
|
||
.grid__column--thirds { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@charset "UTF-8"; | ||
/// Determine if a column count has been given. | ||
/// If no columns have been given return the grid's total column count. | ||
/// | ||
/// @argument {map} $grid | ||
/// | ||
/// @argument {number (unitless) | null} $columns | ||
/// | ||
/// @return {number} | ||
/// | ||
/// @example scss | ||
/// _neat-column-default($neat-grid, 4) | ||
/// | ||
/// @access private | ||
|
||
@function _neat-column-default($grid, $columns) { | ||
@if $columns == null { | ||
$_grid-columns: _retrieve-neat-setting($grid, columns); | ||
@return $_grid-columns; | ||
} @else { | ||
@return $columns; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@import "setup"; | ||
|
||
$eighteen-grid: ( | ||
columns: 18, | ||
gutter: 33px, | ||
); | ||
|
||
.neat-column-default-grid { | ||
content: _neat-column-default($neat-grid, null); | ||
} | ||
|
||
.neat-column-default-grid-custom-col { | ||
content: _neat-column-default($neat-grid, 10); | ||
} | ||
|
||
.neat-column-custom-grid { | ||
content: _neat-column-default($eighteen-grid, null); | ||
} | ||
|
||
.neat-column-custom-grid-custom-col { | ||
content: _neat-column-default($eighteen-grid, 10); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
require "spec_helper" | ||
|
||
describe "neat-column-default" do | ||
before(:all) do | ||
ParserSupport.parse_file("functions/neat-column-default") | ||
end | ||
|
||
context "called with default grid" do | ||
it "gets default columns" do | ||
rule = "content: 12" | ||
|
||
expect(".neat-column-default-grid").to have_rule(rule) | ||
end | ||
|
||
it "gets custom columns" do | ||
rule = "content: 10" | ||
|
||
expect(".neat-column-default-grid-custom-col").to have_rule(rule) | ||
end | ||
end | ||
|
||
context "called with custom grid" do | ||
it "gets default columns" do | ||
rule = "content: 18" | ||
|
||
expect(".neat-column-custom-grid").to have_rule(rule) | ||
end | ||
|
||
it "gets custom columns" do | ||
rule = "content: 10" | ||
|
||
expect(".neat-column-custom-grid-custom-col").to have_rule(rule) | ||
end | ||
end | ||
end |