Skip to content

Commit

Permalink
Merge pull request #43 from Respo/warn-color
Browse files Browse the repository at this point in the history
Warn about color syntax
  • Loading branch information
soyaine committed Jun 9, 2019
2 parents 3433382 + 5cb70c8 commit 23a371a
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 38 deletions.
132 changes: 97 additions & 35 deletions calcit.edn

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion meyvn.edn
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

{:pom {:group-id "respo",
:artifact-id "composer",
:version "0.1.17-a1",
:version "0.1.17-a3",
:name "Respo composer renderer library"}
:packaging {:jar {:enabled true
:remote-repository {:id "clojars"
Expand Down
2 changes: 1 addition & 1 deletion src/composer/comp/editor.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
(=< nil 4)
(cursor-> :operations comp-operations states template (or focused-path []))
(div
{:style (merge ui/flex {:overflow :auto, :padding "0 8px"})}
{:style (merge ui/flex {:overflow :auto, :padding "0 8px 120px 8px"})}
(comp-markup (:markup template) [] focused-path active-paths)
(when config/dev? (comp-inspect "Markup" (:markup template) {:bottom 0}))))
(div {:style {:width 1, :background-color "#eee"}})
Expand Down
13 changes: 12 additions & 1 deletion src/composer/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,18 @@
(->> attrs (map (fn [[k v]] [(keyword k) (read-token v data state)])) (into {}))))

(defn read-styles [style data state]
(->> style (map (fn [[k v]] [k (read-token v data state)])) (into {})))
(->> style
(map
(fn [[k v]]
[k
(cond
(re-matches #"^\#[0-9a-f]{3}$" v)
(do (js/console.warn "Outdated color syntax" v) v)
(re-matches #"^\#[0-9a-f]{6}$" v)
(do (js/console.warn "Outdated color syntax" v) v)
read-token v
data state)]))
(into {})))

(defn style-presets [preset-ids presets]
(->> preset-ids
Expand Down

0 comments on commit 23a371a

Please sign in to comment.