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

jss-nested

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jss-nested

Nested selectors plugin for jss

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
120K
increased by10.66%
Maintainers
1
Weekly downloads
 
Created
Source

Nested selectors plugin for JSS

This plugin implements nested selectors for jss.

Take a look at examples directory.

Put an & before a selector within a rule and it will be replaced by the parent selector and extracted to a separate rule.

{
    '.container': {
        padding: '20px',
        // Will result in .container.clear
        '&.clear': {
            clear: 'both'
        },
        // Will result in .container .button
        '& .button': {
            background: 'red'
        },
        '&.selected, &.active': {
            border: '1px solid red'
        }
    }
}
.container {
    padding: 20px;
}
.container.clear {
    clear: both;
}
.container .button {
    background: red;
}
.container.selected, .container.active {
    border: 1px solid red;
}

Register plugin

var jss = require('jss')
var nested = require('jss-nested')
jss.use(nested)

Run tests

Locally

npm i
open test/local.html

From github

Tests

License

MIT

Keywords

FAQs

Package last updated on 28 Nov 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