Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

styled-ns

maxsbelt6MIT0.1.0

styled-components with namespaces

styled-components

readme

styled-ns

Patched version of styled-components package that supports namespaces.

Installation

Install from the NPM repository using yarn or npm:

yarn add styled-ns
npm install --save styled-ns

Usage

You can use this package exactly the same way as styled-components package:

import React from 'react';
import styled from 'styled-ns';

const Wrapper = styled('section')`
  padding: 4em;
  background: papayawhip;
`;

const Title = styled('h1')`
  font-size: 1.5em;
  text-align: center;
  color: palevioletred;
`;

const Component = () => (
  <Wrapper>
    <Title>Hello World!</Title>
  </Wrapper>
)