Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matype/rework-extend-validator
Rework plugin to validate properties when use `(extend|inherit)s:`
https://github.com/matype/rework-extend-validator
Last synced: 6 days ago
JSON representation
Rework plugin to validate properties when use `(extend|inherit)s:`
- Host: GitHub
- URL: https://github.com/matype/rework-extend-validator
- Owner: matype
- License: other
- Created: 2014-07-26T07:14:59.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-11-21T09:33:14.000Z (almost 10 years ago)
- Last Synced: 2024-10-12T00:36:00.499Z (about 1 month ago)
- Language: JavaScript
- Size: 152 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.markdown
- License: LICENSE
Awesome Lists containing this project
README
# rework-extend-validator [![Build Status](https://travis-ci.org/morishitter/rework-extend-validator.svg)](https://travis-ci.org/morishitter/rework-extend-validator)
Rework plugin to validate properties when use `(extend|inherit)s:`.
## Installation
```shell
$ npm install rework-extend-validator
```## Use
Use with [rework-inherit](https://github.com/reworkcss/rework-inherit/).
```javascript
// Dependencies
var rework = require('rework');
var validator = require('rework-extend-validator');
var extend = require('rework-inherit')();
var fs = require('fs');// CSS to be processed
var css = fs.readFileSync('test/fixtures/test-1.css', 'utf-8').trim();// Process CSS using rework-extend-validator
rework(css).use(validator).use(extend).toString();
```## Example
Throw error if extended rules have same properties.
```css
.foo {
font-size: 16px;
padding: 5px 10px;
}.bar {
color: #fff;
font-size: 14px;
}.baz {
extend: .foo;
extend: .bar;
}
```Run **error**.
## License
The MIT License (MIT)
Copyright (c) 2014 Masaaki Morishita