sebastiaanvisser / clay

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

Render css comments (enhancement) #149

Closed dbaynard closed 5 years ago

dbaynard commented 7 years ago

Sometimes it is useful for output css to have comments. Also is is occasionally useful to have commented out css.


It would be good to have one function that adds a comment.

comment :: Text -> Css

It may be useful to specify during pretty-printing how this comment should be appended to the previous element (same line, end of line).

It would also be helpful to have a function which comments out code, as (for example) this then becomes visible (with strikeout) in chrome developer tools.

commented :: Css -> Css

Names to be bikeshedded.

I can implement if it would be valuable (just not for another few weeks).

seanparsons commented 7 years ago

@dbaynard I'm entirely happy to entertain a PR for this, I can imagine how it would be useful.

dbaynard commented 6 years ago

I've done the relatively straightforward part of this, but it looks like doing it all will require significant changes to the core types. commenting runs the writer, modified the Rules, and then replaces them, which seems a little odd.

I'd eventually like to tackle

That sound ok?

turion commented 5 years ago

If you're still planning on adding that, can you elaborate in a new issue and close this?

dbaynard commented 5 years ago

I do not still intend to add that — I'll close.