Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The custom format helpers createPropertyFormatter does not support passing formatting options #941

Closed
yangchch6 opened this issue Feb 20, 2023 · 3 comments

Comments

@yangchch6
Copy link

In the createPropertyFormatter function, I can't pass in custom formatting attributes, because it will be overridden by hard-coded prefix='--'

image

This code should be changed like this, could you support the fix of this problem?
image

@frshwtr
Copy link

frshwtr commented Apr 25, 2023

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.

@torytang025
Copy link

I had the same problem. It seems like a bug 😢
For me, I copied this file and rewrote it like your proposal

@jorenbroekema
Copy link
Collaborator

#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants