mirror of https://github.com/sveltejs/svelte
feat: allow for `svelte:options` css injected (#12660)
* feat: allow for `svelte:options` css injected * chore: update test with different class * fix: regenerate types * remove external option * regenerate * Update .changeset/eight-comics-tell.md * fix --------- Co-authored-by: Rich Harris <rich.harris@vercel.com> Co-authored-by: Rich Harris <hello@rich-harris.dev>pull/12707/head
parent
be28f8256b
commit
e4e66e237f
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
feat: add support for `<svelte:options css="injected" />`
|
@ -0,0 +1,9 @@
|
||||
<svelte:options css="injected" />
|
||||
|
||||
<div class="bar">bar</div>
|
||||
|
||||
<style>
|
||||
.bar {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,7 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
compileOptions: {
|
||||
css: 'external'
|
||||
}
|
||||
});
|
@ -0,0 +1,4 @@
|
||||
|
||||
.foo.svelte-sg04hs {
|
||||
color: red;
|
||||
}
|
@ -0,0 +1 @@
|
||||
<!--[--><div class="bar svelte-ievf05">bar</div><!----> <div class="foo svelte-sg04hs">foo</div><!--]-->
|
@ -0,0 +1,5 @@
|
||||
<style id="svelte-ievf05">
|
||||
.bar.svelte-ievf05 {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,13 @@
|
||||
<script lang="ts">
|
||||
import Nested from './Nested.svelte';
|
||||
</script>
|
||||
|
||||
<Nested />
|
||||
|
||||
<div class="foo">foo</div>
|
||||
|
||||
<style>
|
||||
.foo {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,7 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
compileOptions: {
|
||||
css: 'external'
|
||||
}
|
||||
});
|
@ -0,0 +1,4 @@
|
||||
|
||||
.foo.svelte-sg04hs {
|
||||
color: red;
|
||||
}
|
@ -0,0 +1 @@
|
||||
<div class="foo svelte-sg04hs">foo</div>
|
@ -0,0 +1,5 @@
|
||||
<style id="svelte-sg04hs">
|
||||
.foo.svelte-sg04hs {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,9 @@
|
||||
<svelte:options css="injected" />
|
||||
|
||||
<div class="foo">foo</div>
|
||||
|
||||
<style>
|
||||
.foo {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
Loading…
Reference in new issue