Skip to content

Commit 4afd6dd

Browse files
authored
Merge pull request #74 from Blond11516/docs/class-in-heex
docs: Indicate that class cannot be used in heex templates
2 parents b1d0ad9 + 0e50c55 commit 4afd6dd

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ This allows you to use the `class` and `class_name` functions in the template an
4747
```eex
4848
<h1 class="_2313dsc-title">Hello world</h1>
4949
```
50+
51+
**Please note that `class` cannot be used in `heex` templates as the HTML
52+
validation engine does not allow it.**
53+
5054
## Advanced usage
5155

5256
### Phoenix.View

lib/ex_css_modules/ex_css_modules.ex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ defmodule ExCSSModules do
5757
5858
Returns nil for a class_name that does not exist.
5959
60+
Note that this function cannot be used with HEEX templates, as the HTML
61+
validation engine does not allow them to be build with arbitrary text.
62+
`class_name/3` should be used instead.
63+
6064
## Examples
6165
6266
iex> class(%{ "hello" => "world"}, "hello")

0 commit comments

Comments
 (0)