diff --git a/CHANGELOG.md b/CHANGELOG.md index cb07e6b852..e6f7e4e136 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Svelte changelog +## 1.28.0 + +* Support `ref:foo` as a CSS selector ([#693](https://github.com/sveltejs/svelte/issues/693)) +* Prevent magic-string bugs by only minifying CSS combinators if `cascade: false` ([#743](https://github.com/sveltejs/svelte/issues/743)) +* Don't throw an error if component is destroyed twice ([#643](https://github.com/sveltejs/svelte/issues/643)) + ## 1.27.0 * Minify CSS and remove unused styles ([#697](https://github.com/sveltejs/svelte/issues/697)) diff --git a/package.json b/package.json index ece5b03b8b..42aec9e8ab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "svelte", - "version": "1.27.0", + "version": "1.28.0", "description": "The magical disappearing UI framework", "main": "compiler/svelte.js", "files": [ diff --git a/src/css/Stylesheet.ts b/src/css/Stylesheet.ts index d0fcd10b70..5680ec4551 100644 --- a/src/css/Stylesheet.ts +++ b/src/css/Stylesheet.ts @@ -39,7 +39,7 @@ class Rule { code.overwrite(c, selector.node.start, separator); } - selector.minify(code); + if (!cascade) selector.minify(code); c = selector.node.end; } }); diff --git a/test/css/samples/combinator-child/_config.js b/test/css/samples/combinator-child/_config.js new file mode 100644 index 0000000000..b37866f9b6 --- /dev/null +++ b/test/css/samples/combinator-child/_config.js @@ -0,0 +1,3 @@ +export default { + cascade: false +}; \ No newline at end of file diff --git a/test/css/samples/combinator-child/expected.css b/test/css/samples/combinator-child/expected.css new file mode 100644 index 0000000000..3f2c64212e --- /dev/null +++ b/test/css/samples/combinator-child/expected.css @@ -0,0 +1 @@ +.test[svelte-xyz]>div[svelte-xyz]{color:#0af} \ No newline at end of file diff --git a/test/css/samples/combinator-child/expected.html b/test/css/samples/combinator-child/expected.html new file mode 100644 index 0000000000..c726b2b537 --- /dev/null +++ b/test/css/samples/combinator-child/expected.html @@ -0,0 +1 @@ +