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

variables

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

variables

CSS Variables polyfill

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

CSS Variables

NPM version Build status Test coverage Dependency Status License Downloads Gittip

A pure regexp-replace version of rework-vars. Differences are:

  • It doesn't use rework or parse the CSS AST
  • It does not remove variable declarations
  • It is much less robust
  • It does not throw error messages

Like rework-vars, it only implements a subset of CSS variables.

API

var variables = require('variables')

css = variables(css)

Do CSS variables magic.

map = variables.parse([map])

Parse CSS variables on :root, storing the variable values in map. Variable names do not include the leading --s.

re = variables.compile(map)

Compile a regular expression for matching var(--<name>)s with names given from map. This regular expression do not match var()s with fallbacks.

css = variables.replace(css, map)

Replace variables in css with a variable map.

Keywords

FAQs

Package last updated on 19 Aug 2014

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