Open-source IoT Platform - Device management, data collection, processing and visualization.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Artem Halushko f8af340464 pulled with master 7 years ago
..
LICENSE pulled with master 7 years ago
README.md pulled with master 7 years ago
camel-case.js pulled with master 7 years ago
extract.js pulled with master 7 years ago
get-template.js pulled with master 7 years ago
index.js pulled with master 7 years ago
literal.js pulled with master 7 years ago
object-parse.js pulled with master 7 years ago
object-parser.js pulled with master 7 years ago
object-stringifier.js pulled with master 7 years ago
object-stringify.js pulled with master 7 years ago
object-syntax.js pulled with master 7 years ago
object.js pulled with master 7 years ago
package.json pulled with master 7 years ago
template-parse.js pulled with master 7 years ago
template-parser-helper.js pulled with master 7 years ago
template-parser.js pulled with master 7 years ago
template-safe-parse.js pulled with master 7 years ago
template-safe-parser.js pulled with master 7 years ago
template-stringifier.js pulled with master 7 years ago
template-stringify.js pulled with master 7 years ago
template-tokenize.js pulled with master 7 years ago
un-camel-case.js pulled with master 7 years ago

README.md

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.