New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

styled-property

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

styled-property

styled-components helper that generates a set of styles and sets the auto-generated className for them as property on a wrapped component

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

styledProperty

npm version Build Status Coverage Status

styled-components helper that generates a set of styles and sets the auto-generated className for them as property on a wrapped component.

Installation

npm install styled-property

Usage

import styledProperty from 'styled-property'
// auto-generates a class selector for the given css and sets it
// as "propName" property on the WrappedComponent.
const Component = styledProperty(WrappedComponent, 'propName')`
  display: block;
`

Use Cases

Set default and active styles of Link component from react-router.

import { Link } from 'react-router'
import styled from 'styled-components'
import styledProperty from 'styled-property'

// create basic Link styles
const BaseLink = styled(Link)`
  color: #aaa;
  display: inline-block;
  text-decoration: none;
`

// create an additional set of style rules and set the "activeClassName
// property of the wrapped component (BaseLink) to the auto-generated
// className for those styles.
const StyledLink = styledProperty(BaseLink, 'activeClassName')`
  color: #bada55;
`

Keywords

react

FAQs

Package last updated on 15 Jan 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