|
| 1 | +module CSS.ListStyle.Type where |
| 2 | + |
| 3 | +import CSS.Common (class Inherit, class Initial, class None, class Unset) |
| 4 | +import CSS.Property (class Val) |
| 5 | +import CSS.String (fromString) |
| 6 | +import CSS.Stylesheet (CSS, key) |
| 7 | +import Data.Eq (class Eq) |
| 8 | +import Data.Function (($)) |
| 9 | +import Data.Generic (class Generic, gShow) |
| 10 | +import Data.Ord (class Ord) |
| 11 | +import Data.Semigroup ((<>)) |
| 12 | +import Data.Show (class Show) |
| 13 | + |
| 14 | +data ListStyleType |
| 15 | + = Disc |
| 16 | + | Circle |
| 17 | + | Square |
| 18 | + | Decimal |
| 19 | + | Georgian |
| 20 | + | CJKIdeographic |
| 21 | + | Kannada |
| 22 | + | None |
| 23 | + | Inherit |
| 24 | + | Initial |
| 25 | + | Unset |
| 26 | + | CustomStyleType String |
| 27 | + | StringStyleType String |
| 28 | + |
| 29 | +derive instance eqListStyleType :: Eq ListStyleType |
| 30 | +derive instance ordListStyleType :: Ord ListStyleType |
| 31 | +derive instance genericListStyleType :: Generic ListStyleType |
| 32 | + |
| 33 | +instance showListStyleType :: Show ListStyleType where |
| 34 | + show = gShow |
| 35 | + |
| 36 | +instance valListStyleType :: Val ListStyleType where |
| 37 | + value (Disc) = fromString "disc" |
| 38 | + value (Circle) = fromString "circle" |
| 39 | + value (Square) = fromString "square" |
| 40 | + value (Decimal) = fromString "decimal" |
| 41 | + value (Georgian) = fromString "georgian" |
| 42 | + value (CJKIdeographic) = fromString "cjk-ideographic" |
| 43 | + value (Kannada) = fromString "kannada" |
| 44 | + value (None) = fromString "none" |
| 45 | + value (Initial) = fromString "initial" |
| 46 | + value (Inherit) = fromString "inherit" |
| 47 | + value (Unset) = fromString "unset" |
| 48 | + value (CustomStyleType s) = fromString ("custom-" <> s) |
| 49 | + value (StringStyleType s) = fromString s |
| 50 | + |
| 51 | +instance initialListStyleType :: Initial ListStyleType where |
| 52 | + initial = Initial |
| 53 | + |
| 54 | +instance inheritListStyleType :: Inherit ListStyleType where |
| 55 | + inherit = Inherit |
| 56 | + |
| 57 | +instance unsetListStyleType :: Unset ListStyleType where |
| 58 | + unset = Unset |
| 59 | + |
| 60 | +instance noneListTypeType :: None ListStyleType where |
| 61 | + none = None |
| 62 | + |
| 63 | +disc :: ListStyleType |
| 64 | +disc = Disc |
| 65 | + |
| 66 | +circle :: ListStyleType |
| 67 | +circle = Circle |
| 68 | + |
| 69 | +square :: ListStyleType |
| 70 | +square = Square |
| 71 | + |
| 72 | +decimal :: ListStyleType |
| 73 | +decimal = Decimal |
| 74 | + |
| 75 | +georgian :: ListStyleType |
| 76 | +georgian = Georgian |
| 77 | + |
| 78 | +cjkIdeographic :: ListStyleType |
| 79 | +cjkIdeographic = CJKIdeographic |
| 80 | + |
| 81 | +kannada :: ListStyleType |
| 82 | +kannada = Kannada |
| 83 | + |
| 84 | +customListStyleType :: String -> ListStyleType |
| 85 | +customListStyleType s = CustomStyleType s |
| 86 | + |
| 87 | +stringListStyleType :: String -> ListStyleType |
| 88 | +stringListStyleType s = StringStyleType s |
| 89 | + |
| 90 | +listStyleType :: ListStyleType -> CSS |
| 91 | +listStyleType = key $ fromString "list-style-type" |
0 commit comments