Browse code
Added stub for auto theme CSS generation
fiddlerwoaroof authored on 17/09/2015 08:11:10
Showing 1 changed files
Showing 1 changed files
... | ... |
@@ -108,4 +108,40 @@ |
108 | 108 |
(defmethod accentize ((colorscheme colorscheme) accent) |
109 | 109 |
(setf (colorscheme-accent colorscheme) (funcall accent colorscheme))) |
110 | 110 |
|
111 |
+ |
|
112 |
+(defun get-paths (tree) |
|
113 |
+ (labels ((get-paths-h (tree &optional tail history result) |
|
114 |
+ (cond ((null tree) (reverse result)) |
|
115 |
+ ((symbolp tree) (cons (cons tree history) (get-paths-h tail nil (cons tree history) result))) |
|
116 |
+ ((listp tree) (cond ((symbolp (car tree)) (get-paths-h (car tree) |
|
117 |
+ (cdr tree) |
|
118 |
+ history |
|
119 |
+ result)) |
|
120 |
+ ((listp (car tree)) |
|
121 |
+ (append (get-paths-h (car tree) nil history) |
|
122 |
+ (get-paths-h (cdr tree) |
|
123 |
+ nil |
|
124 |
+ (cdr history) |
|
125 |
+ result)))))))) |
|
126 |
+ (mapcar (get-paths-h tree)))) ; Don't reverse: that'll be done by the user, as I'm appending to the tree |
|
127 |
+ |
|
128 |
+;;; Eventually this will help concision in themey stuff |
|
129 |
+ |
|
130 |
+;'(a '((:background . color1) (:color . color2)) |
|
131 |
+; (b '((:background . color3))) |
|
132 |
+; ((c + d) ((:border . color1)))) -> |
|
133 |
+ |
|
134 |
+;(lass:compile-and-write |
|
135 |
+; (list a |
|
136 |
+; :background (color1 scheme) |
|
137 |
+; :color (color2 scheme)) |
|
138 |
+; (list (a b) :background (color3 scheme)) |
|
139 |
+; (list (a b (c + d)) :border (color1 scheme))) |
|
140 |
+ |
|
141 |
+;(defmacro gen-css (scheme-v ,@body selectors) |
|
142 |
+; (alexandria:with-gensyms (scheme) |
|
143 |
+; (loop for ()) |
|
144 |
+; ) |
|
145 |
+ |
|
146 |
+; ) |
|
111 | 147 |
; vim: foldmethod=marker foldmarker=&group,&endgroup foldlevel=0 : |