You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

rezi

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rezi

recursive CSS post-processor

1.0.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Rezi: Recursive CSS Compilation in the Browser

Rezi compiles a CSS style based on an input JSON object and injects it into the head of the document in a style tag with the 'rezi' ID.

Like so:

    var sub1aStyle = {
      "color": "blue"
    };

    var sub1Style = {
      "font-size": "2em",
      "color": "red",
      ".sub1a": sub1aStyle
    };

    var bodyStyle = {
      "body": {
        "text-align": "center"
      },
      "div": {
        "border": "1px solid black",
        "margin": "10px"
      },
      ".sub1": sub1Style
    };

    rezi(bodyStyle);

The code above would comiple to the following CSS:


 body {
text-align: center;
}
 div {
border: 1px solid black;
}
 div {
margin: 10px;
}
 .sub1 {
font-size: 2em;
}
 .sub1 {
color: red;
}
 .sub1 .sub1a {
color: blue;
}

which gets injected into the rezi CSS tag in the head of the document.

Keywords

css

FAQs

Package last updated on 08 May 2015

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