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

.sync API #72

Open
gkatsanos opened this issue Mar 20, 2023 · 1 comment
Open

.sync API #72

gkatsanos opened this issue Mar 20, 2023 · 1 comment

Comments

@gkatsanos
Copy link

gkatsanos commented Mar 20, 2023

Just had a nasty issue that took .. a few hours of my life .. using .sync without anything passed, didn't realize an empty array was at least expected.

const plugin = require("tailwindcss/plugin");
const postcssJs = require("postcss-js");
const styles = require("../dist/styles");

module.exports = plugin(function ({ addComponents }) {
  let postcssJsProcess;
  postcssJsProcess = postcssJs.sync(); // ... []
  result = postcssJsProcess(styles);
  addComponents(result);
});

Any way to clarify the Readme a bit to add an example or two for .sync?

@ai
Copy link
Member

ai commented Mar 20, 2023

What problem do you have of passing undefined to postcssJs.sync()?

We can throw an error on missed argument.

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