{"action":"opened","issue":{"url":"https://api.github.com/repos/ladderlife/om-css/issues/7","repository_url":"https://api.github.com/repos/ladderlife/om-css","labels_url":"https://api.github.com/repos/ladderlife/om-css/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/ladderlife/om-css/issues/7/comments","events_url":"https://api.github.com/repos/ladderlife/om-css/issues/7/events","html_url":"https://github.com/ladderlife/om-css/issues/7","id":132500736,"number":7,"title":"Cannot assign classes to child components","user":{"login":"steadicat","id":6031,"avatar_url":"https://avatars.githubusercontent.com/u/6031?v=3","gravatar_id":"","url":"https://api.github.com/users/steadicat","html_url":"https://github.com/steadicat","followers_url":"https://api.github.com/users/steadicat/followers","following_url":"https://api.github.com/users/steadicat/following{/other_user}","gists_url":"https://api.github.com/users/steadicat/gists{/gist_id}","starred_url":"https://api.github.com/users/steadicat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steadicat/subscriptions","organizations_url":"https://api.github.com/users/steadicat/orgs","repos_url":"https://api.github.com/users/steadicat/repos","events_url":"https://api.github.com/users/steadicat/events{/privacy}","received_events_url":"https://api.github.com/users/steadicat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-09T18:55:36Z","updated_at":"2016-02-09T18:55:36Z","closed_at":null,"body":"A common pattern in React is to style child components by assigning CSS classes to them, as if they were regular DOM elements. The child is responsible for passing down the props to the final DOM element so it gets correctly applied. I couldn't find a way to do this with om-css:\r\n\r\n```clojure\r\n(defcomponent component1\r\n  [{:keys [class] :as props} children]\r\n  [:.root {:color :purple}]\r\n  (dom/div\r\n   {:class (concat (props :class) [:root])}\r\n   \"class is now [:root :root], parent's class is lost\"))\r\n\r\n(defcomponent component2\r\n  [props children]\r\n  [:.root {:text-decoration :underline}]\r\n  (component2 {:class [:root]}))\r\n```\r\n"}}