|
|
|
@ -1,7 +1,6 @@ |
|
|
|
(ns NoteHub.views.css-generator |
|
|
|
(use 'cssgen.use) |
|
|
|
(:use [cssgen] |
|
|
|
(css-ns NoteHub.views.css-generator |
|
|
|
[NoteHub.settings] |
|
|
|
(:use [NoteHub.settings])) |
|
|
|
[cssgen.types])) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defn- gen-fontlist [& fonts] |
|
|
|
(defn- gen-fontlist [& fonts] |
|
|
|
(apply str |
|
|
|
(apply str |
|
|
|
@ -11,8 +10,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
; CSS Mixins |
|
|
|
; CSS Mixins |
|
|
|
(def page-width |
|
|
|
(def page-width |
|
|
|
(mixin |
|
|
|
(px (get-setting :page-width #(Integer/parseInt %) 800))) |
|
|
|
:width (px (get-setting :page-width #(Integer/parseInt %) 800)))) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(def helvetica-neue |
|
|
|
(def helvetica-neue |
|
|
|
(mixin |
|
|
|
(mixin |
|
|
|
@ -25,7 +23,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
(def central-element |
|
|
|
(def central-element |
|
|
|
(mixin |
|
|
|
(mixin |
|
|
|
page-width |
|
|
|
:width page-width |
|
|
|
:margin-top :5em |
|
|
|
:margin-top :5em |
|
|
|
:margin-bottom :10em |
|
|
|
:margin-bottom :10em |
|
|
|
:margin-left "auto" |
|
|
|
:margin-left "auto" |
|
|
|
@ -37,16 +35,16 @@ |
|
|
|
:foreground :#ccc |
|
|
|
:foreground :#ccc |
|
|
|
:background-halftone :#444 |
|
|
|
:background-halftone :#444 |
|
|
|
:foreground-halftone :#bbb |
|
|
|
:foreground-halftone :#bbb |
|
|
|
:link-color {:fresh :#6b8 |
|
|
|
:link {:fresh :#6b8 |
|
|
|
:visited :#496 |
|
|
|
:visited :#496 |
|
|
|
:hover :#7c9 }} |
|
|
|
:hover :#7c9 }} |
|
|
|
:default {:background :#fff |
|
|
|
:default {:background :#fff |
|
|
|
:foreground :#333 |
|
|
|
:foreground :#333 |
|
|
|
:background-halftone :#efefef |
|
|
|
:background-halftone :#efefef |
|
|
|
:foreground-halftone :#888 |
|
|
|
:foreground-halftone :#888 |
|
|
|
:link-color {:fresh :#097 |
|
|
|
:link {:fresh :#097 |
|
|
|
:visited :#054 |
|
|
|
:visited :#054 |
|
|
|
:hover :#0a8 }}} keys)) |
|
|
|
:hover :#0a8 }}} keys)) |
|
|
|
|
|
|
|
|
|
|
|
(defn global-css |
|
|
|
(defn global-css |
|
|
|
"Generates the entire CSS rules of the app" |
|
|
|
"Generates the entire CSS rules of the app" |
|
|
|
@ -59,9 +57,9 @@ |
|
|
|
foreground (color theme :foreground) |
|
|
|
foreground (color theme :foreground) |
|
|
|
background-halftone (color theme :background-halftone) |
|
|
|
background-halftone (color theme :background-halftone) |
|
|
|
foreground-halftone (color theme :foreground-halftone) |
|
|
|
foreground-halftone (color theme :foreground-halftone) |
|
|
|
link-fresh (color theme :link-color :fresh) |
|
|
|
link-fresh (color theme :link :fresh) |
|
|
|
link-visited (color theme :link-color :visited) |
|
|
|
link-visited (color theme :link :visited) |
|
|
|
link-hover (color theme :link-color :hover)] |
|
|
|
link-hover (color theme :link :hover)] |
|
|
|
(css |
|
|
|
(css |
|
|
|
(rule "a" |
|
|
|
(rule "a" |
|
|
|
:color link-fresh |
|
|
|
:color link-fresh |
|
|
|
@ -97,7 +95,7 @@ |
|
|
|
:text-align :justify |
|
|
|
:text-align :justify |
|
|
|
:vertical-align :top |
|
|
|
:vertical-align :top |
|
|
|
; Replace this by arithmetic with css-lengths as soon as they fix the bug |
|
|
|
; Replace this by arithmetic with css-lengths as soon as they fix the bug |
|
|
|
:width (px (quot (get-setting :page-width #(Integer/parseInt %) 800) 3))) |
|
|
|
:width (/ page-width 3.0)) |
|
|
|
(rule ".helvetica-neue" |
|
|
|
(rule ".helvetica-neue" |
|
|
|
helvetica-neue) |
|
|
|
helvetica-neue) |
|
|
|
(rule "#hero" |
|
|
|
(rule "#hero" |
|
|
|
@ -115,7 +113,7 @@ |
|
|
|
:text-align :justify |
|
|
|
:text-align :justify |
|
|
|
:font-size :1.2em |
|
|
|
:font-size :1.2em |
|
|
|
(rule "p" |
|
|
|
(rule "p" |
|
|
|
:line-height (% 140)) |
|
|
|
:line-height (% 140)) |
|
|
|
(rule "& > h1:first-child" |
|
|
|
(rule "& > h1:first-child" |
|
|
|
:text-align :center |
|
|
|
:text-align :center |
|
|
|
:margin :2em)) |
|
|
|
:margin :2em)) |
|
|
|
@ -129,7 +127,7 @@ |
|
|
|
(rule "*:focus" |
|
|
|
(rule "*:focus" |
|
|
|
:outline [:0px :none :transparent]) |
|
|
|
:outline [:0px :none :transparent]) |
|
|
|
(rule "textarea" |
|
|
|
(rule "textarea" |
|
|
|
page-width |
|
|
|
:width page-width |
|
|
|
:font-family :Courier |
|
|
|
:font-family :Courier |
|
|
|
:font-size :1em |
|
|
|
:font-size :1em |
|
|
|
:border :none |
|
|
|
:border :none |
|
|
|
|