feat(templ): add queries for script and css declarations

This commit is contained in:
Hoang Nguyen 2023-11-18 00:00:00 +07:00
parent 7cf719975b
commit 9a1ffa28d3
No known key found for this signature in database
GPG key ID: B0567C20730E9B11
2 changed files with 19 additions and 0 deletions

View file

@ -40,6 +40,14 @@
"{" @delimiter
"}" @delimiter @sentinel) @container
(script_block
"{" @delimiter
"}" @delimiter @sentinel) @container
(css_declaration
"{" @delimiter
"}" @delimiter @sentinel) @container
(component_switch_statement
"{" @delimiter
"}" @delimiter @sentinel) @container

View file

@ -57,6 +57,8 @@ templ posts(posts []Post) {
@postsTemplate(posts)
if len(posts) > 0 {
<div>{ "Not empty" }</div>
} else {
<div>{ "Empty" }</div>
}
}
}
@ -71,3 +73,12 @@ templ postsTemplate(posts []Post) {
}
</div>
}
script withParameters(a string, b string, c int) {
console.log(a, b, c);
}
css red() {
background-color: #ff0000;
font-family: "Iosevka";
}