https://github.com/garthdb/postcss-inherit-parser
A parser for postcss-inherit's syntax
https://github.com/garthdb/postcss-inherit-parser
Last synced: 3 months ago
JSON representation
A parser for postcss-inherit's syntax
- Host: GitHub
- URL: https://github.com/garthdb/postcss-inherit-parser
- Owner: GarthDB
- License: apache-2.0
- Created: 2016-08-14T10:12:37.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-02-29T20:32:08.000Z (over 1 year ago)
- Last Synced: 2025-03-29T06:49:02.785Z (3 months ago)
- Language: JavaScript
- Size: 872 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 98
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# PostCSS Inherit Parser
[](https://travis-ci.org/GarthDB/postcss-inherit-parser) [](https://codeclimate.com/github/GarthDB/postcss-inherit-parser) [](https://codeclimate.com/github/GarthDB/postcss-inherit-parser/coverage) [](https://codeclimate.com/github/GarthDB/postcss-inherit-parser) [](https://david-dm.org/GarthDB/postcss-inherit-parser) [](http://inch-ci.org/github/GarthDB/postcss-inherit-parser) [](https://badge.fury.io/js/postcss-inherit-parser)
---
A PostCSS Parser that supports syntax for inherit declarations with pseudo classes.
```css
.b:before {
content: "";
}
.a {
inherit: .b:before;
}
```## Defining `inherit` syntax
Using an options object with a property of `propertyRegExp`, you can define a custom `inherit` syntax.
This example:
```js
parse(
'.a { color: red; } .b { extend: .a; }',
{ propertyRegExp: /^extends?$/ }
);
```would work with this css:
```css
.a {
color: red;
}
.b {
extend: .a;
}
```