Organize code
This commit is contained in:
parent
670d58c505
commit
f9a6a179d1
4 changed files with 30 additions and 3 deletions
30
README.md
30
README.md
|
@ -1,4 +1,4 @@
|
||||||
# gradient-parser
|
# Gradient Parser
|
||||||
|
|
||||||
## About
|
## About
|
||||||
|
|
||||||
|
@ -9,7 +9,33 @@ Parse CSS3 gradient definition and returns AST.
|
||||||
### JavaScript
|
### JavaScript
|
||||||
|
|
||||||
```JavaScript
|
```JavaScript
|
||||||
// TODO
|
var gradient = require('gradient-parser');
|
||||||
|
var obj = gradient.parse('linear-gradient(30deg, #000, transparent)');
|
||||||
|
console.log(JSON.stringify(obj, null, 2));
|
||||||
|
```
|
||||||
|
|
||||||
|
Results in:
|
||||||
|
|
||||||
|
```JSON
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"type": "linear-gradient",
|
||||||
|
"orientation": {
|
||||||
|
"type": "angular",
|
||||||
|
"value": "30"
|
||||||
|
},
|
||||||
|
"colorStops": [
|
||||||
|
{
|
||||||
|
"type": "hex",
|
||||||
|
"value": "000"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "literal",
|
||||||
|
"value": "transparent"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
## Install Choices
|
## Install Choices
|
||||||
|
|
1
index.js
Normal file
1
index.js
Normal file
|
@ -0,0 +1 @@
|
||||||
|
exports.parse = require('./lib/parser');
|
|
@ -23,7 +23,7 @@
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git://github.com/rafaelcaricio/gradient-parser.git"
|
"url": "git://github.com/rafaelcaricio/gradient-parser.git"
|
||||||
},
|
},
|
||||||
"main": "gradient-parser.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "grunt"
|
"test": "grunt"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue