/css-parser

A lightweight CSS parser in JavaScript / TypeScript.

Primary LanguageTypeScriptMIT LicenseMIT

CSS Parser

A lightweight CSS parser in JavaScript / TypeScript.

The returned structure

[
  {
    selector: string;
    type?: string;
    children?: [...];
    comments?: string;
    styles?: string;
    rules?: [
      {
        key: string;
        value: string;
        defective?: boolean;
      }, ...
    ]
  }, ...
]

Quick Start

Install the css-parser from the github repo.

npm install sibvrv/css-parser

Development

Build

npm run build

How to test

npm run test