postcss-values-parser
A CSS property value parser for use with PostCSS
Last updated 5 years ago by shellscape .
MPL-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ npm install postcss-values-parser 
SYNC missed versions from official npm registry.


postcss-values-parser tests cover size

A CSS property value parser built upon PostCSS, following the same node and traversal patterns as PostCSS.

Install

Using npm:

npm install postcss-values-parser --save-dev

Please consider becoming a patron if you find this module useful.

Requirements

postcss-values-parser Node version v6.14.0+ and PostCSS v7.0.0+.

Benefits

  • Leverages PostCSS and its tokenizer under the hood
  • Doesn't strip characters; eg. parenthesis
  • Full AST traversal
  • Ability to walk the AST for every Node type
  • Convenience methods to stringify Nodes
  • Follows PostCSS patterns for whitespace between Nodes
  • Provides convenience properties for number units, colors, etc.

Usage

Using the parser is straightforward and minimalistic:

const { parse } = require('postcss-values-parser');

const root = parse('#fff');
const node = root.first;

// → Word {
//     raws: { before: '', after: '' },
//     value: '#fff',
//     type: 'word',
//     isHex: true,
//     isColor: true,
//     isVariable: false,
//     ...
//   }

Please see the Documentation for further information on using the module.

Meta

CONTRIBUTING

LICENSE (Mozilla Public License)

Current Tags

  • 6.0.2                                ...           latest (3 years ago)
  • 3.0.0-beta.4                                ...           next (6 years ago)

43 Versions

  • 6.0.2                                ...           3 years ago
  • 6.0.1                                ...           3 years ago
  • 6.0.0                                ...           3 years ago
  • 5.0.0                                ...           4 years ago
  • 4.0.0                                ...           4 years ago
  • 3.2.1                                ...           5 years ago
  • 3.2.0                                ...           5 years ago
  • 3.1.1                                ...           5 years ago
  • 3.1.0                                ...           5 years ago
  • 3.0.5                                ...           5 years ago
  • 3.0.4                                ...           6 years ago
  • 3.0.3                                ...           6 years ago
  • 3.0.2                                ...           6 years ago
  • 3.0.1                                ...           6 years ago
  • 3.0.0                                ...           6 years ago
  • 3.0.0-beta.4                                ...           6 years ago
  • 3.0.0-beta.3                                ...           6 years ago
  • 3.0.0-beta.2                                ...           6 years ago
  • 3.0.0-beta.1                                ...           6 years ago
  • 2.0.1                                ...           6 years ago
  • 2.0.0                                ...           6 years ago
  • 1.5.0                                ...           7 years ago
  • 1.4.0                                ...           7 years ago
  • 1.3.2                                ...           7 years ago
  • 1.3.1                                ...           7 years ago
  • 1.3.0                                ...           7 years ago
  • 1.2.2                                ...           7 years ago
  • 1.2.1                                ...           8 years ago
  • 1.2.0                                ...           8 years ago
  • 1.1.0                                ...           8 years ago
  • 1.0.3                                ...           8 years ago
  • 1.0.2                                ...           8 years ago
  • 1.0.1                                ...           8 years ago
  • 1.0.0                                ...           8 years ago
  • 0.1.8                                ...           8 years ago
  • 0.1.7                                ...           8 years ago
  • 0.1.6                                ...           8 years ago
  • 0.1.5                                ...           8 years ago
  • 0.1.4                                ...           9 years ago
  • 0.1.3                                ...           9 years ago
  • 0.1.2                                ...           9 years ago
  • 0.1.1                                ...           9 years ago
  • 0.1.0                                ...           9 years ago

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