css-list

[Deprecated] Use postcss-value-parser instead

MIT 6 个版本
安装
npm install css-list
yarn add css-list
pnpm add css-list
bun add css-list
README

[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', '']
版本列表
0.1.3 2015-09-10
0.1.2 2015-07-13
0.1.1 2015-07-13
0.1.0 2015-05-10
0.0.3 2015-05-02
0.0.2 2015-04-29