Socket
Socket
Sign inDemoInstall

cssvjs

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cssvjs

CSS Value parser


Version published
Weekly downloads
3
increased by200%
Maintainers
1
Install size
220 kB
Created
Weekly downloads
 

Readme

Source

Logo

Fast, Refined CSS Value-Parser



gzip size brotli size Build Status Download count JSDelivr download count No dependencies Current version Support me

Getting Started

⚠ cssvjs is currently not stable and heavily under development. The API might change and all 0.0.x releases should be treated as test / preview releases.

Install via npm:

$ npm install cssvjs

Install via yarn:

$ yarn add cssvjs

Include directly via jsdelivr:

<script src="https://cdn.jsdelivr.net/npm/graceful-ws/dist/cssvjs.min.js"></script>

Usage

import {parse} from 'cssvjs';
// const {parse} = require('cssvjs'); // Without es6 import
// const {parse} = CSSvJS; // In a browser env
console.log(parse(`rgba(40 54 22 / 23%)`));

which will print the following to the console:

{
  type: 'color',
  format: 'rgba',
  value: [
    {type: 'number', value: 40},
    {type: 'number', value: 54},
    {type: 'number', value: 22},
    {type: 'percentage', value: 23}
  ]
}

Supported values

All values are fully tested, submit an issue if you find a bug. I'll slowly fill add more types. Version 1.0.0 will cover all the basic ones.

Keywords

FAQs

Last updated on 18 Oct 2019

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc