postcss-values-parser
A CSS property value parser for use with PostCSS
Last updated 3 months ago by shellscape .
MPL-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm 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

  • 3.2.1                                ...           latest (3 months ago)
  • 3.0.0-beta.4                                ...           next (a year ago)

38 Versions

  • 3.2.1                                ...           3 months ago
  • 3.2.0                                ...           4 months ago
  • 3.1.1                                ...           6 months ago
  • 3.1.0                                ...           6 months ago
  • 3.0.5                                ...           a year ago
  • 3.0.4                                ...           a year ago
  • 3.0.3                                ...           a year ago
  • 3.0.2                                ...           a year ago
  • 3.0.1                                ...           a year ago
  • 3.0.0                                ...           a year ago
  • 3.0.0-beta.4                                ...           a year ago
  • 3.0.0-beta.3                                ...           2 years ago
  • 3.0.0-beta.2                                ...           2 years ago
  • 3.0.0-beta.1                                ...           2 years ago
  • 2.0.1                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.5.0                                ...           2 years ago
  • 1.4.0                                ...           2 years ago
  • 1.3.2                                ...           2 years ago
  • 1.3.1                                ...           3 years ago
  • 1.3.0                                ...           3 years ago
  • 1.2.2                                ...           3 years ago
  • 1.2.1                                ...           3 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.3                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
  • 0.1.8                                ...           4 years ago
  • 0.1.7                                ...           4 years ago
  • 0.1.6                                ...           4 years ago
  • 0.1.5                                ...           4 years ago
  • 0.1.4                                ...           4 years ago
  • 0.1.3                                ...           4 years ago
  • 0.1.2                                ...           4 years ago
  • 0.1.1                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 203
This Week 25,199
This Month 28,385
Last Day 6,693
Last Week 33,031
Last Month 149,586
Dependencies (4)
Dev Dependencies (15)
Dependents (69)

Copyright 2014 - 2016 © taobao.org |