~alcinnz/haskell-stylist

acad9091764c18f94c94af14b62f9d7f9a5966c9 — Adrian Cochrane 4 years ago 2ba0a92
Test counters() handling against longhand rather than shorthand.

Because that's where it'll be passed
1 files changed, 3 insertions(+), 3 deletions(-)

M src/Data/CSS/Preprocessor/Text.hs
M src/Data/CSS/Preprocessor/Text.hs => src/Data/CSS/Preprocessor/Text.hs +3 -3
@@ 54,9 54,9 @@ instance PropertyParser p => PropertyParser (TextStyle p) where
    shorthand self "white-space" [Ident val]
        | val `elem` ["normal", "pre", "pre-wrap", "pre-line"] = [("white-space", [Ident val])]
        | otherwise = shorthand (inner self) "white-space" [Ident val]
    shorthand TextStyle { inner = self' } key value
        | [(k, _)] <- shorthand self' key $ removeCounters value, k == key = [(key, value)]
        | otherwise = shorthand self' key value
    shorthand TextStyle { inner = s } k v
        | Just _ <- longhand s s k $ removeCounters v = [(k, v)]
        | otherwise = shorthand s k v

    longhand _ self "counter-reset" value = (\v -> self {counterReset = v}) <$> parseCounters 0 value
    longhand _ self "counter-increment" value = (\v -> self {counterIncrement = v}) <$> parseCounters 1 value