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

cssvar-interaction

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cssvar-interaction

A tiny JS powered utility to set/update CSS variables using eventListeners

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

cssvar-interaction

npm latest version github version npm bundle size npm downloads stats stats

A tiny JS powered NPM package to set/update CSS variables using eventListeners.

Installation

Install using (Node Package Manager):

npm install cssvar-interaction --save

Usage:

For examples on CSS variables see the (MDN web docs)

  • Write some CSS using CSS variable --x and multiply it by 1 unit of measurement using calc().

    calc( var(--x) * 1px )

  • Apply it to a transform statement with any option:

    transform: translateX(calc(var(--x) * 1px));

  • use it on any CSS selector:

    div {
      transition: all linear 1s;  
      transform: translateX(calc(var(--x) * 1px));
    }
    
  • Include the Eventlisteners into your document:

    <script src="node_modules/cssvar-interation/dist/index.js" />

Examples:

Run npm run test --prefix node_modules/cssvar-interaction in the root of your project to open an HTML demo page with some examples.

Keywords

FAQs

Package last updated on 08 Jul 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