packages feed

css-parser-0.0.2 / src / CssParser / At / Container.hs

module CssParser.At.Container whereimport CssParser.At.MediaQueryimport CssParser.Identimport CssParser.Preludeimport CssParser.Showinstance ShowSpaceBetween Ident ContainerQuery where  cssSpace _ _ = " "instance ShowSpaceBetween (These Ident ContainerQuery) (These Ident ContainerQuery) where  cssSpace _ _ = ", "newtype ContainerQueryMap  = ContainerQueryMap (NonEmpty (These Ident ContainerQuery))  deriving (Show, Eq, Ord, Generic)instance CssShow ContainerQueryMap where  toCssText (ContainerQueryMap cqm) = toCssText cqmdata CqOp  = CqOpFeature MediaFeature  | CqApp Ident ContainerQuery  deriving (Show, Eq, Ord, Generic)instance CssShow CqOp where  toCssText = \case    CqOpFeature f -> "(" <> toCssText f <> ")"    CqApp f (CqFeature (AsIs x@CqOpFeature {})) ->      toCssText f <> toCssText x    CqApp f (CqFeature x) ->      toCssText f <> "(" <> toCssText x <> ")"    CqApp f args ->      toCssText f <> "(" <> toCssText args <> ")"instance ShowParenthesis ContainerQuery CqOp where  left _ _ = ""  right _ _ = ""data ContainerQuery  = CqBin BinOp (Not ContainerQuery CqOp) ContainerQuery  | CqFeature (Not ContainerQuery CqOp)  deriving (Show, Eq, Ord, Generic)instance CssShow ContainerQuery where  toCssText = \case    CqBin bop x l ->      toCssText (CqFeature x) <> toCssText bop  <> toCssText l    CqFeature mf -> toCssText mf