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

jss-extend

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jss-extend

JSS plugin that enables inheritance

  • 5.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
65K
increased by20.18%
Maintainers
1
Weekly downloads
 
Created
Source

JSS plugin that enables inheritance

Gitter

This plugin implements a custom extend style property.

Value of extend property can be a string, object and array. If string is used, it will look for a rule with such a name. If object - plain rule object is expected, if array - an array of plain rule objects is expected.

Rule's own properties always take precedence over extended rules, so you can always override the extended definition.

Examples

const styles = {
  redContainer: {
    background: 'red'
  },
  container: {
    extend: 'redContainer',
    'font-size': '20px'
  }
}
const redContainer = {
  background: 'red'
}
const styles = {
  container: {
    extend: redContainer, // Can be an array of styles
    'font-size': '20px'
  }
}

Compiles to:

.jss-23g44j5 {
  background: red;
  font-size: 20px;
}

Demo

Simple demo

Multi objects demo

Issues

File a bug against cssinjs/jss prefixed with [jss-extend].

Run tests

npm i
npm run test

License

MIT

Keywords

FAQs

Package last updated on 20 Jun 2017

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