Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nv/jscssp
CommonJS module of JavaScript CSS Parser written by Daniel Glazman
https://github.com/nv/jscssp
Last synced: about 2 months ago
JSON representation
CommonJS module of JavaScript CSS Parser written by Daniel Glazman
- Host: GitHub
- URL: https://github.com/nv/jscssp
- Owner: NV
- Created: 2010-09-01T09:11:27.000Z (over 14 years ago)
- Default Branch: CommonJS
- Last Pushed: 2010-10-26T17:06:17.000Z (about 14 years ago)
- Last Synced: 2024-04-15T13:56:34.123Z (8 months ago)
- Language: JavaScript
- Homepage: http://glazman.org/JSCSSP/
- Size: 155 KB
- Stars: 21
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.mdown
Awesome Lists containing this project
README
# [JavaScript CSS Parser](http://glazman.org/JSCSSP/)
## Usage
var CSSParser = require("jscssp").CSSParser;
var cssParser = new CSSParser;
cssParser.parse("h1 {color: red}")
-> {cssRules:
[{type: 1
, parsedCssText: 'h1 {\n color: red;\n}'
, declarations: {type: 1000
, property: 'color'
, values: [{value: 'red'
, type: 1
, name: null
, parentRule: null
, parentStyleSheet: [Circular]
}
]
, valueText: 'red'
, priority: false
, parsedCssText: 'color: red;'
, parentStyleSheet: null
, parentRule: null
}
, mSelectorText: 'h1'
, parentStyleSheet: [Circular]
, parentRule: null
, currentLine: 0
}
]
, variables: {}
}## Installation (for Node.js)
$ npm install jscssp
## Tests
git submodule update --init
open test/index.htmlTo see test results in the console run
node test/*_test.js
## Analogs
* [CSSOM.js](http://github.com/NV/CSSOM)
* [Sheet.js](http://github.com/subtleGradient/Sheet.js)
* [CodeMirror's CSS parser](http://codemirror.net/csstest.html)