An open API service indexing awesome lists of open source software.

https://github.com/grapesjs/parser-postcss

Custom CSS parser for GrapesJS by using PostCSS
https://github.com/grapesjs/parser-postcss

Last synced: 4 months ago
JSON representation

Custom CSS parser for GrapesJS by using PostCSS

Awesome Lists containing this project

README

          

# GrapesJS Parser PostCSS

This plugin enables custom CSS parser via [PostCSS](https://github.com/postcss/postcss). If you import templates from HTML/CSS or embed custom codes (eg. by using [grapesjs-custom-code](https://github.com/GrapesJS/components-custom-code) plugin) you definitely need to use this one to avoid issues with styles, [check here why](http://grapesjs.com/docs/guides/Custom-CSS-parser.html#cssom-results-are-inconsistent).

> Requires GrapesJS v0.14.33 or higher

## Summary

* Plugin name: `grapesjs-parser-postcss`

## Options

This plugin has no options

## Download

* CDN
* `https://unpkg.com/grapesjs-parser-postcss`
* NPM
* `npm i grapesjs-parser-postcss`
* GIT
* `git clone https://github.com/GrapesJS/parser-postcss.git`

## Usage

Directly in the browser
```html

var editor = grapesjs.init({
container : '#gjs',
// ...
plugins: ['grapesjs-parser-postcss'],
});

```

Modern javascript
```js
import grapesjs from 'grapesjs';
import parserPostCSS from 'grapesjs-parser-postcss';

const editor = grapesjs.init({
container : '#gjs',
// ...
plugins: [parserPostCSS],
});
```

## Development

Clone the repository

```sh
$ git clone https://github.com/GrapesJS/parser-postcss.git
$ cd grapesjs-parser-postcss
```

Install dependencies

```sh
$ npm i
```

Start the dev server

```sh
$ npm start
```

## License

BSD 3-Clause