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 426
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Closes #100
- Loading branch information
Reda Lemeden
committed
Jul 20, 2014
1 parent
2615987
commit 4eb67b8
Showing
6 changed files
with
69 additions
and
2 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 |
---|---|---|
|
@@ -19,3 +19,4 @@ | |
@import "grid/media"; | ||
@import "grid/to-deprecate"; | ||
@import "grid/visual-grid"; | ||
@import "grid/display"; |
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,28 @@ | ||
/** | ||
* Changes the display property used by other mixins called in the code block argument. | ||
* | ||
* @param {String} $display (block) - Display value to be used within the block. Can be `table` or `block`. | ||
* | ||
* @example scss | ||
* @include display(table) { | ||
* .display-table { | ||
* @include span-columns(6); | ||
* } | ||
* } | ||
* | ||
* @example css | ||
* // CSS | ||
* .display-table { | ||
* display: table-cell; | ||
* ... | ||
* } | ||
*/ | ||
|
||
@mixin display($display: block) { | ||
$scope-display: $container-display-table; | ||
$container-display-table: if($display == table, true, false) !global; | ||
|
||
@content; | ||
|
||
$container-display-table: $scope-display !global; | ||
} |
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,19 @@ | ||
require 'spec_helper' | ||
|
||
describe "@include display() {...}" do | ||
before(:all) do | ||
ParserSupport.parse_file("display") | ||
end | ||
|
||
context "with argument (table)" do | ||
it "changes display value to table" do | ||
expect('.display-table-block').to have_rule('display: table-cell') | ||
end | ||
end | ||
|
||
context "whith nested call and argument (block)" do | ||
it "changes display value to block" do | ||
expect('.display-nested-block').to have_rule('display: block') | ||
end | ||
end | ||
end |
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,15 @@ | ||
@import 'setup'; | ||
|
||
@include display(table) { | ||
.display-table-block { | ||
@include span-columns(6); | ||
} | ||
} | ||
|
||
@include display(table) { | ||
@include display(block) { | ||
.display-nested-block { | ||
@include span-columns(6); | ||
} | ||
} | ||
} |