Skip to content

Commit

Permalink
feat: support parsing camel case in container queries
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhauhau committed Apr 11, 2024
1 parent 11b8e94 commit 06e7180
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/witty-adults-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

fix parsing camelcase container query name
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit 06e7180

Please sign in to comment.