style-dictionary
style-dictionary copied to clipboard
The custom format helpers `createPropertyFormatter` does not support passing formatting options
In the createPropertyFormatter
function, I can't pass in custom formatting attributes, because it will be overridden by hard-coded prefix='--'
This code should be changed like this, could you support the fix of this problem?
Hello.
I have found the way to get around this is to not set the format
property. You will then need to define all the other formatting styles you need though. This does have some caveats however which makes me think this isn't how it should work.
Bumping this as I would like to be able to use a prefix with format
also being set. In my project, if i remove format
to get the desired prefix, then I lose the behaviour of outputReferences
. I require both for my use case.
I had the same problem. It seems like a bug 😢 For me, I copied this file and rewrote it like your proposal
https://github.com/amzn/style-dictionary/pull/1165 once this is merged and released in v4.0.0-prerelease.27, you will be able to do it like so:
{
destination: 'variables.css',
format: 'css/variables',
options: {
formatting: {
indentation: ' ',
},
},
}
indentation just being one example but the other props work as well such as prefix etc.