New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bemto-components

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bemto-components

BEM + styled-components = 💖

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

bemto-components [WIP]

BEM + styled-components = 💖

Disclaimer

Work in progress. Everything would change, don't treat as a stable thingy.

Install

npm install --save bemto-components

Example usage for modifiers

At definition:

import bemto from 'bemto-components'

const Block = bemto(styled.div`
  background: red;

  &_mod {
    background: lime;
  }
`)

At usage:

<Block _mod />

Just like this.

Hint: you can do elements without this lib

It is possible to use Elements from BEM kinda easy with react and styled components without adding anything extra:

const Block = styled.div`
  background: red;
`

Block.Element = styled.span`
  background: blue;
  
  ${Block}:hover & {
    background: lime;
  }
`

And in usage:

<Block>
  <Block.Element>Hewwo!</Block.Element>
</Block>

This way you can easily couple the element with its block.

Keywords

FAQs

Package last updated on 10 Oct 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