8000 verify multiple component classes · sveltejs/svelte@04d6604 · GitHub
[go: up one dir, main page]

Skip to content

Commit 04d6604

Browse files
committed
verify multiple component classes
1 parent 8f16c13 commit 04d6604

File tree

2 files changed

+94
-0
lines changed

2 files changed

+94
-0
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/* generated by Svelte vX.Y.Z */
2+
import {
3+
SvelteComponent,
4+
append,
5+
element,
6+
init,
7+
mount_component,
8+
safe_not_equal
9+
} from "svelte/internal";
10+
11+
function add_css() {
12+
var style = element("style");
13+
style.id = 'svelte-1ky4mr3-style';
14+
style.textContent = ".custom.svelte-1ky4mr3{color:'blue'}.custom2.svelte-1ky4mr3{background:'fuchsia'}";
15+
append(document.head, style);
16+
}
17+
18+
function create_fragment(ctx) {
19+
var current;
20+
21+
var nested = new ctx.Nested({
22+
props: {
23+
class: "custom custom2 " + otherCls + " svelte-1ky4mr3"
24+
}
25+
});
26+
27+
return {
28+
c() {
29+
nested.$$.fragment.c();
30+
},
31+
32+
m(target, anchor) {
33+
mount_component(nested, target, anchor);
34+
current = true;
35+
},
36+
37+
p(changed, ctx) {
38+
var nested_changes = {};
39+
if (changed.otherCls) nested_changes.class = "custom custom2 " + otherCls + " svelte-1ky4mr3";
40+
nested.$set(nested_changes);
41+
},
42+
43+
i(local) {
44+
if (current) return;
45+
nested.$$.fragment.i(local);
46+
47+
current = true;
48+
},
49+
50+
o(local) {
51+
nested.$$.fragment.o(local);
52+
current = false;
53+
},
54+
55+
d(detaching) {
56+
nested.$destroy(detaching);
57+
}
58+
};
59+
}
60+
61+
let otherCls = 'asd';
62+
63+
function instance($$self) {
64+
const Nested = window.Nested;
65+
66+
return { Nested };
67+
}
68+
69+
class Component extends SvelteComponent {
70+
constructor(options) {
71+
super();
72+
if (!document.getElementById("svelte-1ky4mr3-style")) add_css();
73+
init(this, options, instance, create_fragment, safe_not_equal, []);
74+
}
75+
}
76+
77+
export default Component;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<script>
2+
const Nested = window.Nested;
3+
4+
let otherCls = 'asd';
5+
</script>
6+
7+
<Nested class="custom custom2 {otherCls}" />
8+
9+
<style>
10+
.custom {
11+
color: 'blue';
12+
}
13+
14+
.custom2 {
15+
background: 'fuchsia';
16+
}
17+
</style>

0 commit comments

Comments
 (0)
0