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

How do you overwrite createPropertyFormatter indentation formatting? #922

Open
redonkulus opened this issue Jan 26, 2023 · 1 comment
Open

Comments

@redonkulus
Copy link

redonkulus commented Jan 26, 2023

@dbanksdesign

If using the css format (or any built-in format option), there is no way to overwrite the formatting passed into createPropertyFormatter. Since the switch block happens after the variables are created from the values passed in.

Is the solution to just not use the built-in formatter and create my own?

NOTE: If I try to change the format then TypeScript complains because its not a valid format option:
Screen Shot 2023-01-26 at 8 51 57 AM

@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

2 participants