Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* layers support * finish implementation * add more tests * add more tests
- Loading branch information
1 parent
e2d2890
commit 8bd0173
Showing
8 changed files
with
175 additions
and
27 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
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,9 @@ | ||
"use strict" | ||
|
||
module.exports = function (parentLayer, childLayer) { | ||
if (!parentLayer.length && childLayer.length) return childLayer | ||
if (parentLayer.length && !childLayer.length) return parentLayer | ||
if (!parentLayer.length && !childLayer.length) return [] | ||
|
||
return parentLayer.concat(childLayer) | ||
} |
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,3 @@ | ||
@layer foo { | ||
foo {} | ||
} |
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,10 @@ | ||
@layer layer-alpha, layer-beta.one; | ||
|
||
@import "foo.css" layer; | ||
@import 'bar.css' layer(bar); | ||
@import 'bar.css' layer(bar) level-1 and level-2; | ||
@import url(baz.css) layer; | ||
@import url("foobar.css") layer(foobar); | ||
@import url("foo-layered.css") layer(foo-layered); | ||
|
||
content{} |
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,24 @@ | ||
@layer layer-alpha, layer-beta.one; | ||
@layer{ | ||
foo{} | ||
} | ||
@layer bar{ | ||
bar{} | ||
} | ||
@media level-1 and level-2{ | ||
@layer bar{ | ||
bar{} | ||
} | ||
} | ||
@layer{ | ||
baz{} | ||
} | ||
@layer foobar{ | ||
foobar{} | ||
} | ||
@layer foo-layered{ | ||
@layer foo { | ||
foo {} | ||
} | ||
} | ||
content{} |
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,8 @@ | ||
"use strict" | ||
// external tooling | ||
const test = require("ava") | ||
|
||
// internal tooling | ||
const checkFixture = require("./helpers/check-fixture") | ||
|
||
test("should resolve layers of import statements", checkFixture, "layer") |
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