Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rum issues #62

Open
aliaksandr-s opened this issue Mar 22, 2020 · 1 comment
Open

Rum issues #62

aliaksandr-s opened this issue Mar 22, 2020 · 1 comment

Comments

@aliaksandr-s
Copy link

Using :css inside conditionals in rum components won't compile properly.

Here is an example of a component:

(rum/defcs a-comp < (rum/local false ::selected?)
  [state]
  (let [local-selected? (::selected? state)]
    [:div 
     (if @local-selected?
       [:div
        {:css {:color "red"}}]
       [:div
        {:css {:color "green"}}])]))

And html produced by it:

<div>
  <div css="[object Object]"></div>
</div>
@drewverlee
Copy link

I think im seeing the same issue, though shadow doesn't even seem to produce a build when you try this. The commented outversion that doesn't use merge works, the other does work. It seems to expect a hashmap only.

(rum/defc plant-stage-v2
  [{:keys [grid-column-start grid-column-end grid-row-start grid-row-end] :as m}]
  [:div {:css (merge m {:background-color                  :inherit
                        :border                            0
                        #_#_#_#_#_#_#_#_:grid-column-start grid-column-start
                        :grid-column-end                   grid-column-end
                        :grid-row-start                    grid-row-end
                        :grid-row-end                      grid-row-end

                        })}
   [:img {:css {:width         "100%"
                :height        "100%"
                :object-fit    "cover"
                #_#_:animation plusing-pink-glow
                :border-radius "50%"}
          :src "img/rose.png"}]])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants