js-css-parser

1.0.1 • Public • Published

JSCSSParser

A simple JS function which converts CSS code (as a string) to a javascript object

Getting Started

import JSCSSParser into your project.

npm i --save js-css-parser

Pass in CSS as a string and get a JS object returned.

Object Format

Example

With this as input

body { color: red }

Expect this as a result

[
    {
        selector: "body", 
        declarations: [
            {
                property: "color", 
                value: "red"
            }
        ]
    }
]

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i js-css-parser

    Weekly Downloads

    3

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    4.86 kB

    Total Files

    6

    Last publish

    Collaborators

    • mattrhysgregory