diff --git a/package.json b/package.json index 19fb073..87cc008 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "postcss-font-variant": "^2.0.0", "postcss-initial": "^1.3.1", "postcss-media-minmax": "^2.1.0", + "postcss-nesting": "^2.0.5", "postcss-pseudo-class-any-link": "^1.0.0", "postcss-pseudoelements": "^3.0.0", "postcss-selector-matches": "^2.0.0", diff --git a/src/__tests__/fixtures/features/nesting.css b/src/__tests__/fixtures/features/nesting.css new file mode 100644 index 0000000..f447c01 --- /dev/null +++ b/src/__tests__/fixtures/features/nesting.css @@ -0,0 +1,7 @@ +.foo { + color: red; + + @nest & .bar { + color: white; + } +} diff --git a/src/__tests__/fixtures/features/nesting.expected.css b/src/__tests__/fixtures/features/nesting.expected.css new file mode 100644 index 0000000..5b82fa2 --- /dev/null +++ b/src/__tests__/fixtures/features/nesting.expected.css @@ -0,0 +1,6 @@ +.foo { + color: red +} +.foo .bar { + color: white +} diff --git a/src/features.js b/src/features.js index f6892eb..5400684 100644 --- a/src/features.js +++ b/src/features.js @@ -6,6 +6,9 @@ export default { calc(options) { return require("postcss-calc")(options) }, + nesting(options) { + return require("postcss-nesting")(options) + }, customMedia(options) { return require("postcss-custom-media")(options) },