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

@f/apply-styles

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@f/apply-styles

Apply a style object to a DOM node

  • 1.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-60%
Maintainers
1
Weekly downloads
 
Created
Source

apply-styles

Build status Git tag NPM version Code style

Apply a style object to a DOM node, optionally diffing against a previous set of styles.

Installation

$ npm install @f/apply-styles

Usage

var applyStyles = require('@f/apply-styles')

function setAttribute (node, name, value, prevValue) {
  if (name === 'style') {
    applyStyles(node, value, prevValue)
  }

  // ...set other kinds of attributes...
}

API

applyStyles(node, styles, prevStyles)

  • node - The DOM node to apply the styles to
  • styles - The styles you want to set
  • prevStyles - Optional, a previous style object to diff against (i.e. remove props that are not set in the current style)

Returns: void

License

MIT

FAQs

Package last updated on 08 Jun 2016

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