Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/garthdb/postcss-inherit-parser
A parser for postcss-inherit's syntax
https://github.com/garthdb/postcss-inherit-parser
Last synced: 16 days 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 (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-02-29T20:32:08.000Z (10 months ago)
- Last Synced: 2024-12-15T21:36:12.846Z (19 days ago)
- Language: JavaScript
- Size: 872 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 98
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# PostCSS Inherit Parser
[![Build Status](https://travis-ci.org/GarthDB/postcss-inherit-parser.svg?branch=master)](https://travis-ci.org/GarthDB/postcss-inherit-parser) [![Code Climate](https://codeclimate.com/github/GarthDB/postcss-inherit-parser/badges/gpa.svg)](https://codeclimate.com/github/GarthDB/postcss-inherit-parser) [![Test Coverage](https://codeclimate.com/github/GarthDB/postcss-inherit-parser/badges/coverage.svg)](https://codeclimate.com/github/GarthDB/postcss-inherit-parser/coverage) [![Issue Count](https://codeclimate.com/github/GarthDB/postcss-inherit-parser/badges/issue_count.svg)](https://codeclimate.com/github/GarthDB/postcss-inherit-parser) [![Dependency Status](https://david-dm.org/GarthDB/postcss-inherit-parser.svg)](https://david-dm.org/GarthDB/postcss-inherit-parser) [![Inline docs](http://inch-ci.org/github/GarthDB/postcss-inherit-parser.svg?branch=master)](http://inch-ci.org/github/GarthDB/postcss-inherit-parser) [![npm version](https://badge.fury.io/js/postcss-inherit-parser.svg)](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;
}
```