amzn / style-dictionary

A build system for creating cross-platform styles.
https://styledictionary.com
Apache License 2.0
3.85k stars 537 forks source link

Allow to define comment style #967

Open lukasoppermann opened 1 year ago

lukasoppermann commented 1 year ago

There is a commentStyle proper in the formatter, however it seems that at least in css this can not be overwritten: https://github.com/amzn/style-dictionary/blob/main/lib/common/formatHelpers/createPropertyFormatter.js#L52

Would be great if this option could be added: https://amzn.github.io/style-dictionary/#/formats?id=cssvariables

options.commentStyle could either be short or none ot it could be a boolean.

dbanksdesign commented 1 year ago

I think that makes sense. It sounds like you are looking to turn off comments for specific files, maybe we expose that as an option on file configs?

lukasoppermann commented 1 year ago

Exactly, I want to turn it off. Exposing it like this would be perfect.

jorenbroekema commented 5 months ago

https://github.com/amzn/style-dictionary/commit/b9270b20f19749f3e8670f523580b132c76e7b29#diff-a8a4f9ccb2376c2ec73098072d8621be67c94e04cf9cc2e1b575a28aee5202e4R333 I added a feature for this, both in v3 and v4

jorenbroekema commented 5 months ago

Actually, it doesnt support "none", if you do that you might get #ffffff; undefined or something along those lines, should be easy to add though, PR welcome