🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@uppercod/css-to-object

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uppercod/css-to-object

css-to-json is a package that transforms the syntax from css to JSON format using regular expressions

1.1.1
latest
Source
npm
Version published
Weekly downloads
1.1K
-85.54%
Maintainers
1
Weekly downloads
 
Created
Source

css-to-object

css-to-object is a package that transforms the syntax from css to JSON format using regular expressions

The result is an object that shows properties, selectors and nests, example:

input css

.a {
    width: 200px;
    .b {
        font-size: 100px;
        &:hover {
            background: teal;
        }
    }
}

@media (max-width: 200px) {
    .b {
        font-size: 100px;
    }
}

output css

{
    ":host": {
        ".a ": {
            "width": "200px",
            ".b ": {
                "font-size": "100px",
                "&:hover ": { "background": "teal" }
            }
        },
        "@media (max-width: 200px) ": { ".b ": { "font-size": "100px" } }
    }
}

Note that the output is encapsulated in a :host selector.

FAQs

Package last updated on 04 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts