Skip to content

Commit

Permalink
Add explanation for CSS property names
Browse files Browse the repository at this point in the history
  • Loading branch information
Deraen committed Jun 3, 2024
1 parent dfd4a08 commit 0a8441c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/UsingHiccupToDescribeHTML.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ Use a string as a key for the `:style` map:
[:span {:style {"--custom-property" "value"}}]
```

NOTE: This is due to how Reagent turns keywords as map keys to Object
properties with conversion from snake-case to camelCase, which React
also uses with CSS properties (vs. regular CSS). It could be possible
to change the implementation to skip the case-conversion for properties
starting with `--` but it isn't implemented now.

## Special interpretation of `class` attribute

In JavaScript, `class` is a reserved keyword, so React uses the `className` to specify class attibutes. Reagent just uses `class`.
Expand Down

0 comments on commit 0a8441c

Please sign in to comment.