$(define font-family "Lucida Grande, Verdana, Lucida, Helvetica, Arial")
$(define button-margin "margin-left: 4px; margin-top: 2px;")
input[type=text] {
font-family: $font-family;
}
button {
font-family: $font-family;
margin: $button-margin;
}
== Adding shorthands ==
The function ,(
$(define-hss-type lframe "div[hssclass=hop-lframe]"
:body "div[hssclass=hop-lfbody]"
(define-hss-property (-hop-label-margin v)
(format "padding: ~l;" v))
(define-hss-property (-hop-label-border v)
(format "div[hssclass=hop-lfborder] { border: ~l; }" v))
(define-hss-property (padding v)
(format "div[hssclass=hop-lfbody] { padding: ~l; }" v))
(define-hss-property (-hop-label-border-radius v)
(format "div[hssclass=hop-lfborder] { border-radius: ~l; }" v))
(define-hss-property (-hop-label-align v)
(format "div[hssclass=hop-lflabel] { text-align: ~l; }" v))
(define-hss-property (-hop-label-offset v)
(format "div[hssclass=hop-lflabel] { top: -~l; }" v))
(define-hss-property (background v)
(list (format "background: ~a;" (car v))
(format "div[hssclass=hop-lflabel] > span { background: ~a; }"
(car v)))))
$(define-hss-type lflabel "div[hssclass=hop-lflabel] span")
names ++lframe++ the compound descriptor ++div[hssclass=hop-lframe]++. This name
can be used as any regular descriptor. For instance:
lframe span.foo {
border: 1px solid red;
}
is turned equivalent to:
div[hssclass=hop-lframe] span.foo {
border: 1px solid red;
}
by the aliasing declared above.
== Evaluation and caching ==
HSS files could be cached by HOP servers. Hence, the HOP expressions
embedded inside such files should not be excepted to be evaluated more
than once. The execution should be insensitive to multiple evaluations.
== Complete example ==
For the sake of the example, here is the HSS file used for the HOP
document center.
,(let ((path (make-file-name (doc-dir) "doc.hss")))
(if (file-exists? path)
(:style "max-width: 80em; overflow: auto" :class "source" (decorate-api-code (read-string (current-input-port)))))))) path))