https://github.com/panthevm/clj-ph-css
Clojure wrapper for ph-css
https://github.com/panthevm/clj-ph-css
clojure css parser
Last synced: 11 months ago
JSON representation
Clojure wrapper for ph-css
- Host: GitHub
- URL: https://github.com/panthevm/clj-ph-css
- Owner: Panthevm
- License: mit
- Created: 2021-03-27T17:46:04.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-09T16:34:15.000Z (almost 5 years ago)
- Last Synced: 2024-04-25T08:01:51.760Z (over 1 year ago)
- Topics: clojure, css, parser
- Language: Clojure
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clj-ph-css
Clojure wrapper for [ph-css](https://github.com/phax/ph-css)
[](https://clojars.org/clj-ph-css)
## Quickstart Tutorial ##
```clj
(use 'clj-ph-css.core)
(def schema
(string->schema "foo bar {baz:zaz}"))
;; => #'clj-ph-css.core/schema
schema
;; =>
;; [{:selectors
;; [{:members
;; [{:value "foo" :group :type :type :member-simple}
;; {:name " " :type :selector-combinator}
;; {:value "bar" :group :type :type :member-simple}]
;; :type :selector}]
;; :declarations
;; [{:property "baz"
;; :expression "zaz"
;; :important? false
;; :type :declaration}]
;; :type :style-rule}]
(schema->string schema)
;;=> "foo bar{baz:zaz}"
```