All Projects → gucong3000 → postcss-jsx

gucong3000 / postcss-jsx

Licence: MIT license
PostCSS syntax for parsing CSS in JS literals

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to postcss-jsx

postcss-styled
PostCSS syntax for parsing styled components
Stars: ✭ 53 (-27.4%)
Mutual labels:  syntax, postcss, css-in-js
Vscode Stylelint
A Visual Studio Code extension to lint CSS/SCSS/Less with stylelint
Stars: ✭ 260 (+256.16%)
Mutual labels:  postcss, css-in-js
React Postcss
Simple style tag for React
Stars: ✭ 9 (-87.67%)
Mutual labels:  postcss, css-in-js
Stylelint
A mighty, modern linter that helps you avoid errors and enforce conventions in your styles.
Stars: ✭ 9,350 (+12708.22%)
Mutual labels:  postcss, css-in-js
styled-jsx-plugin-postcss
Plugin to add PostCSS support to styled-jsx.
Stars: ✭ 86 (+17.81%)
Mutual labels:  postcss, css-in-js
Css In React
🍭 CSS in React - Learn the best CSS in JS frameworks by example
Stars: ✭ 101 (+38.36%)
Mutual labels:  postcss, css-in-js
Postjss
Use the power of PostCSS in compiling with JSS
Stars: ✭ 40 (-45.21%)
Mutual labels:  postcss, css-in-js
Comby
A tool for structural code search and replace that supports ~every language.
Stars: ✭ 912 (+1149.32%)
Mutual labels:  syntax, parsing
Kgt
BNF wrangling and railroad diagrams
Stars: ✭ 312 (+327.4%)
Mutual labels:  syntax, parsing
postcss-styl
PostCSS parser plugin for converting Stylus syntax to PostCSS AST.
Stars: ✭ 15 (-79.45%)
Mutual labels:  syntax, postcss
Naomi
Sublime Text enhanced syntax highlighting for JavaScript ES6/ES7/ES2015/ES2016/ES2017+, Babel, FlowType, React JSX, Styled Components, HTML5, SCSS3, PHP 7, phpDoc, PHPUnit, MQL4. Basic: Git config files.
Stars: ✭ 544 (+645.21%)
Mutual labels:  syntax, postcss
Postcss Less
PostCSS Syntax for parsing LESS
Stars: ✭ 93 (+27.4%)
Mutual labels:  syntax, postcss
Vue Highlight.js
📜 Highlight.js syntax highlighter component for Vue.
Stars: ✭ 180 (+146.58%)
Mutual labels:  syntax
tailwind
Makes using TailwindCSS in NativeScript a whole lot easier!
Stars: ✭ 128 (+75.34%)
Mutual labels:  postcss
Lexical syntax analysis
编译原理词法分析器&语法分析器LR(1)实现 C++
Stars: ✭ 173 (+136.99%)
Mutual labels:  syntax
Command
A library to build command line applications using PHP
Stars: ✭ 164 (+124.66%)
Mutual labels:  syntax
starter-kit
🏃 A simple and powerful Starter Kit made with Webpack, Gulp 4, Pug and SASS
Stars: ✭ 21 (-71.23%)
Mutual labels:  postcss
Haskell Symbol Search Cheatsheet
Haskell/GHC symbol search cheatsheet
Stars: ✭ 243 (+232.88%)
Mutual labels:  syntax
React Ast
render abstract syntax trees with react
Stars: ✭ 160 (+119.18%)
Mutual labels:  syntax
Es6
ES5 vs ES6 Reference
Stars: ✭ 158 (+116.44%)
Mutual labels:  syntax

PostCSS JSX Syntax

NPM version Travis Travis Codecov David

PostCSS syntax for parsing CSS in JS literals:

Getting Started

First thing's first, install the module:

npm install postcss-syntax postcss-jsx --save-dev

Use Cases

const postcss = require('postcss');
const stylelint = require('stylelint');
const syntax = require('postcss-syntax');
postcss([stylelint({ fix: true })]).process(source, { syntax: syntax }).then(function (result) {
	// An alias for the result.css property. Use it with syntaxes that generate non-CSS output.
	result.content
});

input:

import glm from 'glamorous';
const Component1 = glm.a({
	flexDirectionn: 'row',
	display: 'inline-block',
	color: '#fff',
});

output:

import glm from 'glamorous';
const Component1 = glm.a({
	color: '#fff',
	display: 'inline-block',
	flexDirectionn: 'row',
});

Advanced Use Cases

Add support for more css-in-js package:

const syntax = require('postcss-syntax')({
	"i-css": (index, namespace) => namespace[index + 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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].