PostCSS JSX Syntax
PostCSS syntax for parsing CSS in JS literals:
- aphrodite
- astroturf
- csjs
- css-light
- cssobj
- electron-css
- emotion
- freestyler
- glamor
- glamorous
- j2c
- linaria
- lit-css
- react-native
- react-style
- reactcss
- styled-components
- styletron-react
- styling
- typestyle
Getting Started
First thing's first, install the module:
npm install postcss-syntax postcss-jsx --save-dev
Use Cases
const postcss = ;const stylelint = ;const syntax = ;;
input:
;const Component1 = glm;
output:
;const Component1 = glm;
Advanced Use Cases
Add support for more css-in-js
package:
const syntax = namespaceindex + 1 === "addStyles" "styled-components": true;
See: postcss-syntax
Style Transformations
The main use case of this plugin is to apply PostCSS transformations to CSS code in template literals & styles as object literals.