File tree Expand file tree Collapse file tree 4 files changed +19
-6
lines changed
example-resources/public/devcards Expand file tree Collapse file tree 4 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 1+ .red-box {
2+ border : 5px solid red;
3+ }
Original file line number Diff line number Diff line change 1212 <!-- <link id="com-rigsomelight-devcards-css" href="/devcards/css/com_rigsomelight_devcards.css"
1313 rel="stylesheet" type="text/css"> -->
1414 < link href ="/devcards/css/two-zero.css " rel ="stylesheet " type ="text/css ">
15+ < link href ="/devcards/css/devcard-api.css " rel ="stylesheet " type ="text/css ">
1516 </ head >
1617 < body >
1718 < script src ="/devcards/js/compiled/devdemos.js " type ="text/javascript "> </ script >
Original file line number Diff line number Diff line change 392392 :inspect-data false ;; wether to display the data in the card atom
393393 :watch-atom true ;; wether to watch the atom and render on change
394394 :history false ;; wether to record a change history of the atom
395+ :classname " " ;; provide card with a custom classname
395396 }
396397 ```
397398
418419 {}
419420 {:padding false })
420421
422+ (defcard custom-classname
423+ (str " this card has a custom class `.red-box`" )
424+ {}
425+ {:classname " red-box" })
426+
421427(defcard inspect-data
422428 (fn [data-atom owner]
423429 (sab/html [:div [:h3 " Inspecting data on this Counter: " (:count @data-atom)]
Original file line number Diff line number Diff line change 134134; ; returns a react component of rendered edn
135135
136136(defn- naked-card [children card]
137- (sab/html
138- [:div
139- {:class
140- (str devcards.system/devcards-rendered-card-class
141- (if (get-in card [:options :padding ]) " com-rigsomelight-devcards-devcard-padding" " " )) }
142- children]))
137+ (let [classname (get-in card [:options :classname ])
138+ padding? (get-in card [:options :padding ])]
139+ (sab/html
140+ [:div
141+ {:class
142+ (cond-> devcards.system/devcards-rendered-card-class
143+ padding? (str " com-rigsomelight-devcards-devcard-padding" )
144+ (not-empty classname) (str " " classname))}
145+ children])))
143146
144147(defn- frame
145148 ([children]
You can’t perform that action at this time.
0 commit comments