Skip to content

guilherme-teodoro/stylish

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stylish

A better way to write CSS without selectors using Garden compile.

Clojars Project

Installation

Add to project.clj: [stylish "0.1.0"]

How it works

The render a given style ruleset, returning the produced an unique CSS class name.

Syntax

Garden Syntax wiki

Example

(ns stylish.example
  (:require [stylish.core :as stylish]
            [garden.units :as units]))

(defn style
  [color]
  [{:font-size (units/px 40)
    :background color}])

(def button-style
  [{:color :yellow}
   [:&:hover {:color :blue}]])

(defn show
  []
  [:div {:class (stylish/render (style color))} ;; return: stylish_example-style-1
   [:button {:class (stylish/render button-style)}]]) ;; return: stylish_example-button-style-1

Contributors

Thanks

Garden for a great Clojure CSS compiler

License

Copyright © 2017 Guilherme Teodoro

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

Releases

No releases published

Packages

No packages published