From c01a64fa4281c9736f3e9da3505f0e8caf52cb14 Mon Sep 17 00:00:00 2001 From: Spencer Florence Date: Tue, 30 Dec 2014 14:07:21 -0600 Subject: [PATCH] moved coloring to css file --- private/html.rkt | 12 ++++++------ private/main.css | 12 +++++++++++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/private/html.rkt b/private/html.rkt index 32351d4..ce1bd36 100644 --- a/private/html.rkt +++ b/private/html.rkt @@ -129,12 +129,12 @@ '((br ())))) (define (mode-xml mode body) - (define color + (define class (case mode - [(yes) "green"] - [(no) "red"] - [(missing) "black"])) - `(span ((style ,(string-append "color:" color))) ,@body)) + [(yes) "covered"] + [(no) "uncovered"] + [(missing) "missing"])) + `(span ((class ,class)) ,@body)) (module+ test (define (test file out) @@ -145,5 +145,5 @@ (clear-coverage!)) (define f (path->string (simplify-path path))) (test f - `((span ((style "color:green")) + `((span ((class "covered")) ,@(encode-string (file->string f)))))) diff --git a/private/main.css b/private/main.css index 10f9bb5..a06a5f3 100644 --- a/private/main.css +++ b/private/main.css @@ -1,3 +1,13 @@ .code { font-family: "Lucida Console", Monaco, monospace; -} \ No newline at end of file +} + +.uncovered { + color:red; +} + +.covered { + color:green; +} + +.missing {} \ No newline at end of file