1.1.0 • Published 2 days ago

@griffel/postcss-syntax v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 days ago

Postcss syntax for Griffel

A postcss custom syntax for Javascript files that contain Griffel CSS in JS code.

Parser

The parser will parse a Javascript file and return the CSS output of any Griffel makeStyle or makeResetStyle calls. The parsed postcss AST will include source locations back to the original Javascript code.

Stringifier

The stringifier only works on a postcss AST that was parsed by this custom syntax since Griffel ahead of time compilation lacks the capability to map generated CSS back to the original javascript properties very accurately.

Configuring @griffel/babel-preset

The preprocessor uses transforms in the @griffel/babel-preset package. In order to configure the babel transform that is used internally, we've created the a factory to return the custom syntax that uses the desired configuration.

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

For more information about how to configure the babel Griffel preset you can check out the docs

1.1.0

2 days ago

1.0.8

7 days ago

1.0.7

2 months ago

1.0.6

2 months ago

1.0.5

4 months ago

1.0.4

5 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

7 months ago

1.0.0

8 months ago