Skip to content

Commit

Permalink
Clarify how class/style works in ~H, closes #3602
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Jan 4, 2025
1 parent 603c8ec commit f5651fb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/phoenix_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -613,10 +613,9 @@ defmodule Phoenix.Component do
For example, `<input required={true}>` is the same as `<input required>`;
* `false` or `nil` - if a value is `false` or `nil`, the attribute is omitted.
Some attributes may be rendered with an empty value, for optimization
purposes, if it has the same effect as omitting. For example,
`<checkbox checked={false}>` renders to `<checkbox>` while,
`<div class={false}>` renders to `<div class="">`;
Note the `class` and `style` attributes in regular HTML tags will be rendered
as empty strings, instead of ommitted, which has the same effect and allows
for rendering optimizations.
* `list` (only for the `class` attribute) - each element of the list is processed
as a different class. `nil` and `false` elements are discarded.
Expand Down

0 comments on commit f5651fb

Please sign in to comment.