New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

css-var-in-js

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

css-var-in-js

Straightforward helper functions to manipulate CSS variables in JS

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

CSS Variables in JS

Straightforward helper functions to manipulate CSS variables in JS

Usage

This package is available as a UMD, CommonJS and ES module build. This allows you to import the package as you see fit.

To get quickly get started, include the following script tag in your site's HTML file;

<script src="https://unpkg.com/css-var-in-js"></script>

The cssVarInJS variable is now globally available to use.

<script>
    const { getVar, setVar } = cssVarInJS

    setVar('--fav-color', 'rebeccapurple')

    getVar('--fav-color')
    // 'rebeccapurple'
</script>

Alternatively, you can install the package from npm, by running 'npm i css-var-in-js' and import it in your project;

import setVar, { getVar } from 'css-var-in-js'

// or

const cssVarInJS = require('css-var-in-js')

Contributing

This project is open to and encourages contributions! Feel free to discuss any bug fixes/features in the issues. If you wish to work on this project:

  1. Fork the project
  2. Create your feature branch (git checkout -b new-feature-branch)
  3. Commit your changes (git commit -am 'add new feature')
  4. Push to the branch (git push origin new-feature-branch)
  5. Submit a pull request!

Keywords

FAQs

Package last updated on 13 Apr 2019

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