|
|
|
@ -2,7 +2,11 @@ |
|
|
|
(:use [cssgen] |
|
|
|
(:use [cssgen] |
|
|
|
[cssgen.types])) |
|
|
|
[cssgen.types])) |
|
|
|
|
|
|
|
|
|
|
|
(defn gen-comma-list [& fonts] (apply str (interpose "," fonts))) |
|
|
|
(defn gen-fontlist [& fonts] |
|
|
|
|
|
|
|
(apply str |
|
|
|
|
|
|
|
(interpose "," |
|
|
|
|
|
|
|
(map #(str "'" % "'") |
|
|
|
|
|
|
|
(filter identity fonts))))) |
|
|
|
|
|
|
|
|
|
|
|
(def page-width |
|
|
|
(def page-width |
|
|
|
(mixin |
|
|
|
(mixin |
|
|
|
@ -10,10 +14,10 @@ |
|
|
|
(def helvetica-neue |
|
|
|
(def helvetica-neue |
|
|
|
(mixin |
|
|
|
(mixin |
|
|
|
:font-weight 300 |
|
|
|
:font-weight 300 |
|
|
|
:font-family (gen-comma-list "'Helvetica Neue'" |
|
|
|
:font-family (gen-fontlist "Helvetica Neue" |
|
|
|
"Helvetica" |
|
|
|
"Helvetica" |
|
|
|
"Arial" |
|
|
|
"Arial" |
|
|
|
"'Lucida Grande'" |
|
|
|
"Lucida Grande" |
|
|
|
"sans-serif"))) |
|
|
|
"sans-serif"))) |
|
|
|
(def central-element |
|
|
|
(def central-element |
|
|
|
(mixin |
|
|
|
(mixin |
|
|
|
@ -33,8 +37,11 @@ |
|
|
|
:background-halftone :#efefef |
|
|
|
:background-halftone :#efefef |
|
|
|
:foreground-halftone :#888 }} [theme tone])) |
|
|
|
:foreground-halftone :#888 }} [theme tone])) |
|
|
|
|
|
|
|
|
|
|
|
(defn global-css [arg] |
|
|
|
(defn global-css [params] |
|
|
|
(let [theme (if arg (keyword arg) :default) |
|
|
|
(let [theme (params :theme) |
|
|
|
|
|
|
|
theme (if theme (keyword theme) :default) |
|
|
|
|
|
|
|
header-fonts (gen-fontlist (params :header-font) "Noticia Text" "PT Serif") |
|
|
|
|
|
|
|
text-fonts (gen-fontlist (params :text-font) "Georgia") |
|
|
|
background (color theme :background) |
|
|
|
background (color theme :background) |
|
|
|
foreground (color theme :foreground) |
|
|
|
foreground (color theme :foreground) |
|
|
|
background-halftone (color theme :background-halftone) |
|
|
|
background-halftone (color theme :background-halftone) |
|
|
|
@ -66,7 +73,7 @@ |
|
|
|
(rule "article" |
|
|
|
(rule "article" |
|
|
|
central-element |
|
|
|
central-element |
|
|
|
:line-height (% 140) |
|
|
|
:line-height (% 140) |
|
|
|
:font-family :Georgia |
|
|
|
:font-family text-fonts |
|
|
|
:font-size :1.2em |
|
|
|
:font-size :1.2em |
|
|
|
(rule "& > h1:first-child" |
|
|
|
(rule "& > h1:first-child" |
|
|
|
:text-align :center |
|
|
|
:text-align :center |
|
|
|
@ -104,4 +111,4 @@ |
|
|
|
:border-bottom [:1px :dashed foreground-halftone] |
|
|
|
:border-bottom [:1px :dashed foreground-halftone] |
|
|
|
:margin-bottom :5em) |
|
|
|
:margin-bottom :5em) |
|
|
|
(rule "h1, h2, h3, h4" |
|
|
|
(rule "h1, h2, h3, h4" |
|
|
|
:font-family (gen-comma-list "'Noticia Text'" "'PT Serif'"))))) |
|
|
|
:font-family header-fonts)))) |
|
|
|
|