mirror of
https://github.com/penpot/penpot.git
synced 2025-05-30 04:06:12 +02:00
✨ Adds CSS modules to the build pipeline
This commit is contained in:
parent
0e585cd585
commit
94a98a1866
6 changed files with 134 additions and 7 deletions
21
frontend/src/app/main/style.clj
Normal file
21
frontend/src/app/main/style.clj
Normal file
|
@ -0,0 +1,21 @@
|
|||
;; This Source Code Form is subject to the terms of the Mozilla Public
|
||||
;; License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
;;
|
||||
;; Copyright (c) KALEIDOS INC
|
||||
|
||||
(ns app.main.style
|
||||
"A fonts loading macros."
|
||||
(:require
|
||||
[app.common.data :as d]
|
||||
[clojure.data.json :as json]))
|
||||
|
||||
(defmacro css
|
||||
[selector]
|
||||
(let [;; Get the associated styles will be module.cljs => module.css.json
|
||||
filename (:file (meta *ns*))
|
||||
styles-file (str "./src/" (subs filename 0 (- (count filename) 4)) "css.json")
|
||||
data (-> (slurp styles-file)
|
||||
(json/read-str))
|
||||
result (get data (d/name selector))]
|
||||
`~result))
|
|
@ -448,7 +448,7 @@
|
|||
(assert (even? (count params)))
|
||||
(str/join " " (reduce (fn [acc [k v]]
|
||||
(if (true? (boolean v))
|
||||
(conj acc (name k))
|
||||
(conj acc (d/name k))
|
||||
acc))
|
||||
[]
|
||||
(partition 2 params))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue