Skip to content

Commit

Permalink
Document splices in classes and IDs (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
lambda-fairy committed Nov 2, 2020
1 parent 3af1397 commit 159b408
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/content/splices-toggles.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,20 @@ html! {
}
```

### Splices in classes and IDs

Splices can also be used in classes and IDs.

```rust
let name = "rarity";
let severity = "critical";
html! {
aside#(name) {
p.{ "color-" (severity) } { "This is the worst! Possible! Thing!" }
}
}
```

### What can be spliced?

You can splice any value that implements [`std::fmt::Display`][Display]. Most primitive types (such as `str` and `i32`) implement this trait, so they should work out of the box.
Expand Down

0 comments on commit 159b408

Please sign in to comment.