sebastiaanvisser / clay

A CSS preprocessor as embedded Haskell.
Other
357 stars 72 forks source link

Add tests for the Clay.Media module #245

Closed chungyc closed 1 year ago

chungyc commented 1 year ago

I was bothered by the lack of tests, so I added some for this single module. Adding more tests covering the entire library would be nice, but that was too ambitious to do in one go.

In the process, I noticed that there was a bug when rendering a key-only media feature such as color. The syntax for Media Queries requires that media features always be surrounded by parentheses, but Clay omitted parentheses for these features. So I also made a change to the Clay.Render module.

https://w3c.github.io/csswg-drafts/mediaqueries-5/#mq-syntax

turion commented 1 year ago

Thanks again for a thoughtful PR that I could learn from.