Socket
Book a DemoInstallSign in
Socket

styled-scopify

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

styled-scopify

A wrapper function for styled-components that scopes all of your CSS rules to a root selector

0.2.0
latest
Source
npmnpm
Version published
Weekly downloads
8
Maintainers
1
Weekly downloads
 
Created
Source

styled-scopify

A wrapper function for styled-components that scopes all of your CSS rules to a root selector. This is useful if you use something like the postcss-scopify plugin. The wrapper function is curried and accepts two arguments - a CSS selector string to use as the scope and the original styled function - and returns the wrapped styled function.

Install

# Yarn
yarn add styled-scopify

# npm
npm install --save styled-scopify

Type Definitions

styledScopify :: String selector -> styled -> styled

Examples

// src/styled.js
import styled from 'styled-components';
import styledScopify from 'styled-scopify';

export default styledScopify('#root', styled);

// src/components/Foo.js
import styled from '../styled';

const Foo = styled.span`
  font-size: 14px;
  color: #333;
`;

// Without this wrapper function you'd have to do this for every component:
const Bar = styled.div`
  #root & {
    ...
  }
`;

FAQs

Package last updated on 24 Jun 2020

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.