sebastiaanvisser / clay

A CSS preprocessor as embedded Haskell.
Other
360 stars 73 forks source link

Add `commenting` to annotate value with comment #157

Closed dbaynard closed 6 years ago

dbaynard commented 6 years ago

This PR adds a new function commenting which annotates a value with a comment. For example,

commenting :: CommentText -> Css -> Css
infixl 3 `commenting`

"A comment" `commenting` display displayNone

becomes

{
    display: none /* A comment */;
}

Only the pretty configuration is set to include comments by default.

The implementation means that if the supplied Css has multiple properties, all those in the top level will be annotated.

This does some of #149 (the relatively straightforward bit).

I'd be grateful to have this merged, if you are happy to do so, as soon as possible, as I'd like to use the new feature for updates to a downstream library (jgm/skylighting#27).

dbaynard commented 6 years ago

Thanks, @seanparsons. When could you schedule a 0.12.3 release?

seanparsons commented 6 years ago

@dbaynard I'm sure I can manage one this week.

dbaynard commented 6 years ago

That sounds great. In the meanwhile, I'll see whether I can fix any of the other issues on the tracker.

seanparsons commented 6 years ago

@dbaynard 0.12.3 release is now pushed.