Skip to content

Instantly share code, notes, and snippets.

@gf3

gf3/css.clj Secret

Created October 7, 2013 22:12
Show Gist options
  • Save gf3/991fe68c75d98ad4b8de to your computer and use it in GitHub Desktop.
Save gf3/991fe68c75d98ad4b8de to your computer and use it in GitHub Desktop.
Dynamic garden stylesheet generation
(ns app.css
(:refer-clojure :exclude [+ - * /])
(:require [garden.core :refer [css]]
[garden.color :as color :refer [hsl hsla rgb]]
[garden.arithmetic :refer [+ - * /]]
[garden.units :as u :refer [em px pt]]))
(def active-color "#1292C9")
(def app-background-color "#F6F6F6")
(def background-color "#3E3A60")
(def dark-color "#40464B")
(def action-text {:font-weight 700
:text-transform "uppercase"})
(def main
(css
;;-----------------------------------------------------------------------------
;; Base
;;-----------------------------------------------------------------------------
[:html :body
{:height "100%"}]))
(ns app.routes
(:require [compojure.core :refer :all]
[app.css :as css]))
(defroutes css-routes
(GET "/css/main.css" []
{:status 200
:headers {"Content-Type" "text/css; charset=utf-8"}
:body css/main}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment