Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@csson/csson

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@csson/csson

A JSON superset with additional types from CSS

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

CSSON

A JSON superset with additional types from CSS

About

CSSON is a superset of JSON that is parsed according to CSS syntax.

Any JSON can be parsed as CSSON, though not every CSS Style Sheet can be parsed as CSSON.

Pros:

  • CSSON syntax is more expressive and forgiving than JSON syntax, making it friendlier to use
  • CSSON includes more types than JSON, allowing your environment to handle the pieces of information in a smarter way
  • Comments

Cons:

  • less built-in language support, compared to JSON or XML

CSSON Objects

JSON Types

  • <json-number>
  • <json-string>
  • <json-true>
  • <json-false>
  • <json-null>
  • <json-array>
  • <json-object>

CSS Types

CSSON Types

  • <csson-array>
  • <csson-object>

It's JLJ (Just like JSON)

CSSON always attemps to parse a JSON type first, so 1 will always be a <json-number>, not a <css-number>.

Converting CSS Types to JSON Types

  • <css-ident> becomes a <json-string>
ident
"ident"
  • <css-hash> becomes a <json-string>
#hash
"#hash"
  • <css-url> becomes a <json-string>
url(https://url.com)
"https://url.com"
  • <css-qualified-rule> becomes a <json-object>
selector {
  property: value;
}
{
  "selector": {
    "property": "value"
  }
}

Rules

  • maximum one value per slot where a value could go
1      /* valid */
1 2 3  /* invalid */
{
  number: 1;      /* valid */
  number: 1 2 3;  /* invalid */
}

Keywords

FAQs

Package last updated on 10 Feb 2020

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc