Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matype/css-annotation-block
A css-annotation module to return the specific nodes
https://github.com/matype/css-annotation-block
Last synced: 6 days ago
JSON representation
A css-annotation module to return the specific nodes
- Host: GitHub
- URL: https://github.com/matype/css-annotation-block
- Owner: matype
- License: other
- Created: 2015-03-10T12:33:22.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-30T22:53:01.000Z (over 7 years ago)
- Last Synced: 2024-10-28T22:25:58.329Z (15 days ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.markdown
- Changelog: changelog
- License: license
Awesome Lists containing this project
README
# css-annotation-block [![Build Status](https://travis-ci.org/morishitter/css-annotation-block.svg)](https://travis-ci.org/morishitter/css-annotation-block)
A [css-annotation](https://github.com/morishitter/css-annotation-block) module to return the specific nodes
## Install
```shell
$ npm install css-annotation-block
```## Example
`input.css`:
```css
/* @start foo */.class {
font-size: 12px;
}/* @end foo */
``````js
var fs = require('fs')
var cssAnnotationBlock = require('css-annotation-block')var css = fs.readFileSync('input.css', 'utf-8').trim()
cssAnnotationBlock(css)
/* Return: [ { name: 'foo', nodes: [ [Object] ] } ] */
````name` is the name of its block.
`nodes` is PostCSS's Node object.## License
The MIT License (MIT)
Copyright (c) 2015 Masaaki Morishita