--- factorcss/CSS.hs 2004/12/27 19:45:02 63 +++ factorcss/CSS.hs 2005/02/27 13:53:48 73 @@ -2,13 +2,14 @@ -- This file is part of FactorCSS -- Licensed under the MIT License, -- http://www.opensource.org/licenses/mit-license --- Copyright 2004 James Bursa +-- Copyright 2005 James Bursa -- -- Datatypes for CSS module CSS where import List +import Numeric data Stylesheet = Stylesheet @@ -119,6 +120,7 @@ show_simple_selector :: SimpleSelector -> String show_simple_selector (Just s, ds) = s ++ (concat . map show_detail) ds +show_simple_selector (Nothing, []) = "*" show_simple_selector (Nothing, ds) = (concat . map show_detail) ds show_detail :: Detail -> String @@ -145,11 +147,11 @@ show_values = concat . intersperse " " . map show_value show_value :: Value -> String -show_value (Number n) = show n -show_value (Percentage p) = show p ++ "%" +show_value (Number n) = showFFloat Nothing n "" +show_value (Percentage p) = showFFloat Nothing p "%" show_value (Length l) = l -show_value (Ems e) = show e ++ "em" -show_value (Exs x) = show x ++ "ex" +show_value (Ems e) = showFFloat Nothing e "em" +show_value (Exs x) = showFFloat Nothing x "ex" show_value (Angle a) = a show_value (Time t) = t show_value (Freq f) = f