Skip to content

Commit 92be916

Browse files
committed
Fix for cljs when a ns does not exist in clojure
1 parent 17a3ef9 commit 92be916

File tree

2 files changed

+7
-39
lines changed

2 files changed

+7
-39
lines changed

notebooks/ornament_next.clj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575

7676
(hiccup/render [:img {:class [square]}])
7777

78+
7879
;; You can also use it in styled components, to pull those additional style
7980
;; rules into the CSS of the component.
8081

@@ -91,7 +92,10 @@
9192

9293
;; These can be defined with or without
9394

94-
(o/defprop without-default)
95-
(o/defprop color-primary "hsla(201, 100%, 50%, 1)")
95+
(o/defprop --without-default)
96+
(o/defprop --color-primary "hsla(201, 100%, 50%, 1)")
97+
98+
99+
(hiccup/render [:img {:style {:backgroun-color --color-primary}}])
96100

97101
(o/defined-styles)

src/lambdaisland/ornament.cljc

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
(ns lambdaisland.ornament
22
"CSS-in-clj(s)"
3-
<<<<<<< Updated upstream
43
#?@
54
(:clj
65
[(:require
@@ -20,40 +19,6 @@
2019
[meta-merge.core :as meta-merge])]
2120
:cljs
2221
[(:require [clojure.string :as str] [garden.util :as gu])]))
23-
||||||| Stash base
24-
(:require [clojure.string :as str]
25-
[meta-merge.core :as meta-merge]
26-
#?@(:clj [[clojure.walk :as walk]
27-
[garden.compiler :as gc]
28-
[garden.core :as garden]
29-
[garden.color :as gcolor]
30-
[garden.types :as gt]
31-
[garden.stylesheet :as gs]
32-
[girouette.version :as girouette-version]
33-
[girouette.tw.core :as girouette]
34-
[girouette.tw.preflight :as girouette-preflight]
35-
[girouette.tw.typography :as girouette-typography]
36-
[girouette.tw.color :as girouette-color]
37-
[girouette.tw.default-api :as girouette-default]]))
38-
#?(:cljs
39-
(:require-macros [lambdaisland.ornament :refer [defstyled]])))
40-
=======
41-
(:require [clojure.string :as str]
42-
[meta-merge.core :as meta-merge]
43-
#?@(:clj [[clojure.walk :as walk]
44-
[garden.compiler :as gc]
45-
[garden.core :as garden]
46-
[garden.color :as gcolor]
47-
[garden.types :as gt]
48-
[garden.stylesheet :as gs]
49-
[girouette.version :as girouette-version]
50-
[girouette.tw.core :as girouette]
51-
[girouette.tw.preflight :as girouette-preflight]
52-
[girouette.tw.typography :as girouette-typography]
53-
[girouette.tw.color :as girouette-color]]))
54-
#?(:cljs
55-
(:require-macros [lambdaisland.ornament :refer [defstyled]])))
56-
>>>>>>> Stashed changes
5722

5823
#?(:clj
5924
(defonce ^{:doc "Registry of styled components
@@ -800,7 +765,7 @@
800765
rules (process-rules
801766
(eval `(do
802767
(in-ns '~(ns-name *ns*))
803-
~(cons 'list rules))))]
768+
~(cons 'clojure.core/list rules))))]
804769
(register! rules-registry varsym {:rules rules})
805770
(when-not (:ns &env)
806771
`(def ~rules-name ~(render-docstring docstring rules) '~rules)))))
@@ -1008,4 +973,3 @@
1008973
(sort-by :index)
1009974
(mapcat :rules)
1010975
process-rules))
1011-

0 commit comments

Comments
 (0)