(ns some-app
(:require
[com.fulcrologic.fulcro-css.localized-dom :as dom]
[com.fulcrologic.fulcro-css.css-injection :as inj]
[com.fulcrologic.fulcro-css.css :as css]))
...
;; OPTION 1: 4th arg destructing (requires adding props middleware)
(defsc UIElement [this props computed {:keys [red]}]
{:query ...
:css [[:.red {:color "red"}]]}
;; OPTION 2: Destructure them explicitly
(let [{:keys [red]} (css/get-classnames UIElement)]
;; OPTION 3: Use `localized-dom` keyword classes instead of `dom` for elements
(dom/div :.red
(dom/li {:classes [red]})))
...)
(defsc Root [this props]
{...normal options ...}
(dom/div {}
;; Auto-scan the query to find components with CSS and inject it
(inj/style-element {:component Root})
...))