postcss-syntax

WebJar for postcss-syntax

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

postcss-syntax
Последняя версия

Последняя версия

0.36.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

postcss-syntax
WebJar for postcss-syntax
Ссылка на сайт

Ссылка на сайт

https://www.webjars.org
Система контроля версий

Система контроля версий

https://github.com/gucong3000/postcss-syntax

Скачать postcss-syntax

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/postcss-syntax/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>postcss-syntax</artifactId>
    <version>0.36.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/postcss-syntax/
implementation 'org.webjars.npm:postcss-syntax:0.36.2'
// https://jarcasting.com/artifacts/org.webjars.npm/postcss-syntax/
implementation ("org.webjars.npm:postcss-syntax:0.36.2")
'org.webjars.npm:postcss-syntax:jar:0.36.2'
<dependency org="org.webjars.npm" name="postcss-syntax" rev="0.36.2">
  <artifact name="postcss-syntax" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='postcss-syntax', version='0.36.2')
)
libraryDependencies += "org.webjars.npm" % "postcss-syntax" % "0.36.2"
[org.webjars.npm/postcss-syntax "0.36.2"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

PostCSS Syntax

NPM version Travis Travis Codecov David

postcss-syntax can automatically switch the required PostCSS syntax by file extension/source

Getting Started

First thing's first, install the module:

npm install postcss-syntax --save-dev

If you want support SCSS/SASS/LESS/SugarSS syntax, you need to install these module:

If you want support HTML (and HTML-like)/Markdown/CSS-in-JS file format, you need to install these module:

Use Cases

const postcss = require('postcss');
const syntax = require('postcss-syntax')({
	rules: [
		{
			test: /\.(?:[sx]?html?|[sx]ht|vue|ux|php)$/i,
			extract: 'html',
		},
		{
			test: /\.(?:markdown|md)$/i,
			extract: 'markdown',
		},
		{
			test: /\.(?:[cm]?[jt]sx?|es\d*|pac)$/i,
			extract: 'jsx',
		},
		{
			// custom language for file extension
			test: /\.postcss$/i,
			lang: 'scss'
		},
		{
			// custom language for file extension
			test: /\.customcss$/i,
			lang: 'custom'
		},
	],

	// custom parser for CSS (using `postcss-safe-parser`)
	css: 'postcss-safe-parser',
	// custom parser for SASS (PostCSS-compatible syntax.)
	sass: require('postcss-sass'),
	// custom parser for SCSS (by module name)
	scss: 'postcss-scss',
	// custom parser for LESS (by module path)
	less: './node_modules/postcss-less',
	// custom parser for SugarSS
	sugarss: require('sugarss'),
	// custom parser for custom language
	custom: require('postcss-custom-syntax'),

});
postcss(plugins).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
});

Версии библиотеки

Версия
0.36.2
0.34.0