css-list

[Deprecated] Use postcss-value-parser instead

Deprecated.
Last updated 9 years ago by trysound .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install css-list 
SYNC missed versions from official npm registry.

[Deprecated] Use postcss-value-parser instead

css-list Build Status

css parsing helpers

API

If separators is not specified, it will default to [' ', '\n', '\t', ',', '/'].

list.each(input[, separators], cb)

list.each('"50%" 50%/100% calc(100% + 20%)', [' ', '/'], function (value, type) {
	// "50%" quote
	// 50% null
	// 100% null
	// calc(100% + 20%) func
});

list.map(input[, separators], cb)

list.map('"50%" 50%/100% calc(100% + 20%)', [' ', '/'], function (value, type, prevValue, prevType) {
	if(type === 'func' || type === 'quote') {
		return type;
	}
});
// quote 50%/100% func

list.split(input[, separators], last)

// space
list.split('10px 20px 5px 15px')', ['\n', '\t', ' '])
// ['10px', '20px', '5px', '15px']
// comma
list.split('10px, 20px, 5px, ')', [','], true)
// ['10px', '20px', '5px', '']

Current Tags

  • 0.1.3                                ...           latest (9 years ago)

6 Versions

  • 0.1.3 [deprecated]           ...           9 years ago
  • 0.1.2 [deprecated]           ...           9 years ago
  • 0.1.1 [deprecated]           ...           9 years ago
  • 0.1.0 [deprecated]           ...           10 years ago
  • 0.0.3 [deprecated]           ...           10 years ago
  • 0.0.2 [deprecated]           ...           10 years ago
Maintainers (2)
Downloads
Total 6
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE