feat: support parsing camel case in container queries (#11131)

pull/11148/head
Tan Li Hau 9 months ago committed by GitHub
parent 11b8e94f9c
commit 41eb8daab2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix parsing camelcase container query name

@ -26,7 +26,7 @@ export function parse() {
// Container name doesn't match a query keyword, so assign it as container name.
if (!CONTAINER_QUERY_KEYWORDS.has(container_name.toLowerCase())) {
name = container_name;
this.eatIdent(container_name);
this.eat(Ident);
}
}

@ -0,0 +1 @@
.main.svelte-xyz{container-name:myContainer;container-type:inline-size}@container myContainer (min-width: 300px){h1.svelte-xyz{color:red}}

@ -0,0 +1,13 @@
<h1 class="main">hello</h1>
<style lang="css">
.main {
container-name: myContainer;
container-type: inline-size;
}
@container myContainer (min-width: 300px) {
h1 {
color: red;
}
}
</style>
Loading…
Cancel
Save