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

Documentation on @griffel/postcss-syntax package #591

Open
benkeen opened this issue Aug 2, 2024 · 1 comment
Open

Documentation on @griffel/postcss-syntax package #591

benkeen opened this issue Aug 2, 2024 · 1 comment
Labels
📃 documentation Improvements or additions to documentation

Comments

@benkeen
Copy link
Contributor

benkeen commented Aug 2, 2024

Hey folks! I was hoping to find some better doc on the @griffel/postcss-syntax package. All that's provided is listed here:
https://github.com/microsoft/griffel/blob/main/packages/postcss-syntax/README.md

But there's no clear connection between how the syntax being defined in that file is used in @griffel/babel-preset. I'll continue working at it and I'm sure I'll figure it out at some point, but I know other people are equally confused.

Thanks!

@benkeen benkeen closed this as completed Aug 2, 2024
@benkeen benkeen reopened this Aug 2, 2024
@benkeen
Copy link
Contributor Author

benkeen commented Aug 2, 2024

It looks like the return value from createSyntax could be used right in the babel definition, so:

const { createSyntax } = require('@griffel/postcss-syntax');
const syntax = createSyntax({
  modules: [
    { moduleSource: '@myScope/griffel', importName: 'createStyles' },
  ]
});

And with a demo babel config:

{
  "presets": [
    [
      "@griffel",
      {
        "modules": [{ "moduleSource": "custom-package", "importName": "makeStyles" }]
      }
    ]
  ]
}

Would be:

{
  "presets": [
    [
      "@griffel",
      syntax
    ]
  ]
}

But this returns a validation failure (babel 5): Validation failed for passed config: data must NOT have additional properties

@layershifter layershifter added the 📃 documentation Improvements or additions to documentation label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📃 documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants