From 0a8441cd69a9fb3f44ec36296388cbbc8cd8ccad Mon Sep 17 00:00:00 2001 From: Juho Teperi Date: Mon, 3 Jun 2024 14:20:49 +0300 Subject: [PATCH] Add explanation for CSS property names --- doc/UsingHiccupToDescribeHTML.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/UsingHiccupToDescribeHTML.md b/doc/UsingHiccupToDescribeHTML.md index c9f98499..a28394d9 100644 --- a/doc/UsingHiccupToDescribeHTML.md +++ b/doc/UsingHiccupToDescribeHTML.md @@ -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`.