diff --git a/lib/postcssToCsso.js b/lib/postcssToCsso.js index 315b4ca..77adcf8 100644 --- a/lib/postcssToCsso.js +++ b/lib/postcssToCsso.js @@ -50,7 +50,7 @@ function postcssToCsso(node) { loc: getInfo(node), name: node.name, prelude: node.params - ? parseToCsso(node.params, { context: 'atrulePrelude', atrule: node.name }, node) + ? parseToCsso(node.params, { context: 'atrulePrelude', atrule: node.name === 'container' ? 'media' : node.name }, node) : null, block: null }; diff --git a/test/test.js b/test/test.js index b9cf2ca..94b8ff3 100644 --- a/test/test.js +++ b/test/test.js @@ -205,6 +205,14 @@ describe('ast transformations', () => { [ '.test { padding-top: 1px; padding-right: 2px; padding-bottom: 1px; padding-left: 2px }', '.test{padding:1px 2px}' + ], + [ + '@media (min-width: 600px) { .media { width: 150px} }', + '@media (min-width:600px){.media{width:150px}}' + ], + [ + '@container (min-width : 700px) { .main { width: 200px } }', + '@container (min-width:700px){.main{width:200px}}' ] ];