/[james]/factorcss/CSS.hs
ViewVC logotype

Diff of /factorcss/CSS.hs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 63 by james, Mon Dec 27 19:45:02 2004 UTC revision 73 by james, Sun Feb 27 13:53:48 2005 UTC
# Line 2  Line 2 
2  -- This file is part of FactorCSS  -- This file is part of FactorCSS
3  -- Licensed under the MIT License,  -- Licensed under the MIT License,
4  --                http://www.opensource.org/licenses/mit-license  --                http://www.opensource.org/licenses/mit-license
5  -- Copyright 2004 James Bursa <james@semichrome.net>  -- Copyright 2005 James Bursa <james@semichrome.net>
6  --  --
7    
8  -- Datatypes for CSS  -- Datatypes for CSS
9    
10  module CSS where  module CSS where
11  import List  import List
12    import Numeric
13    
14  data Stylesheet  data Stylesheet
15          = Stylesheet          = Stylesheet
# Line 119  show_selector ((ss, c):zs) = show_simple Line 120  show_selector ((ss, c):zs) = show_simple
120    
121  show_simple_selector :: SimpleSelector -> String  show_simple_selector :: SimpleSelector -> String
122  show_simple_selector (Just s, ds) = s ++ (concat . map show_detail) ds  show_simple_selector (Just s, ds) = s ++ (concat . map show_detail) ds
123    show_simple_selector (Nothing, []) = "*"
124  show_simple_selector (Nothing, ds) = (concat . map show_detail) ds  show_simple_selector (Nothing, ds) = (concat . map show_detail) ds
125    
126  show_detail :: Detail -> String  show_detail :: Detail -> String
# Line 145  show_values :: [Value] -> String Line 147  show_values :: [Value] -> String
147  show_values = concat . intersperse " " . map show_value  show_values = concat . intersperse " " . map show_value
148    
149  show_value :: Value -> String  show_value :: Value -> String
150  show_value (Number n) = show n  show_value (Number n) = showFFloat Nothing n ""
151  show_value (Percentage p) = show p ++ "%"  show_value (Percentage p) = showFFloat Nothing p "%"
152  show_value (Length l) = l  show_value (Length l) = l
153  show_value (Ems e) = show e ++ "em"  show_value (Ems e) = showFFloat Nothing e "em"
154  show_value (Exs x) = show x ++ "ex"  show_value (Exs x) = showFFloat Nothing x "ex"
155  show_value (Angle a) = a  show_value (Angle a) = a
156  show_value (Time t) = t  show_value (Time t) = t
157  show_value (Freq f) = f  show_value (Freq f) = f

Legend:
Removed from v.63  
changed lines
  Added in v.73

  ViewVC Help
Powered by ViewVC 1.1.26