-
-
Notifications
You must be signed in to change notification settings - Fork 283
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add missing support for templ.SafeCSS in optional CSS class expr…
…essions, fixes #162
- Loading branch information
Showing
5 changed files
with
72 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,5 @@ | |
<div class="a c"></div> | ||
<div class="a"></div> | ||
<input type="email" id="email" name="email" class="a b" placeholder="[email protected]" autocomplete="off"/> | ||
<button class="bg-violet-500 hover:bg-violet-600">Save changes</button> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,11 +26,16 @@ templ KVExample() { | |
<input type="email" id="email" name="email" class={ "a", "b", "c", templ.KV("c", false) } placeholder="[email protected]" autocomplete="off"/> | ||
} | ||
|
||
templ PsuedoAttributes() { | ||
<button class={ "bg-violet-500", templ.KV(templ.SafeClass("hover:bg-violet-600"), true) }>Save changes</button> | ||
} | ||
|
||
templ ThreeButtons() { | ||
{! Button("A") } | ||
{! Button("B") } | ||
<button class={ templ.Classes(green) } type="button">{ "Green" }</button> | ||
{! MapCSSExample() } | ||
{! KVExample() } | ||
{! PsuedoAttributes() } | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters