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

rebem-helper

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rebem-helper

Simple BEM helper with ReasonMl

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

reBEM Helper CircleCI

npm version Coverage Status

A simple BEM helper using ReasonMl

How to install

  1. Install reBEM Helper
npm install rebem-helper

or

yarn add rebem-helper
  1. Add rebem-helper to "bs-dependencies" section of bsconfig.json

How to use

open ReBemHelper;

/* Write my-block my-block--active */
let isActive = true;
let myBemClassNames = bem(~block="my-block", ~modifiers=[Boolean("active", isActive)], ());
open ReBemHelper;

/* Write class names: my-block my-block--small */
let mySizeBemClassNames = bem(~block="my-block", ~modifiers=[String("small")], ());
open ReBemHelper;
/* Write class names: my-block my-block--active my-block--small my-block--disable */
let mySizeBemClassNames = bem(
  ~block="my-block",
  ~modifiers=[
    String("small"),
    Boolean("active", isActive),
    Switch("enable", "disable", false)
  ],
  ()
);
open ReBemHelper;
/* Write class names: my-block__element my-block__element--small some-other-class */
let mySizeBemClassNames = bem(~block="my-block", ~element="element", ~modifiers=[String("small")], ~others="some-other-class", ());

Modifier list

  • String(modifierName) String(string)
  • Boolean(modifierName, shouldShowModifierName) Boolean(string, bool)
  • Switch(activeModifierName, unactiveModifierName, isActiveModifierName) Switch(string, string, bool)

Examples

See more examples in examples folder:

Development

Install and code.

yarn install
yarn start

Run tests

yarn test

Run tests (on watch)

yarn test:dev

How to contribute

Please feel free to write an issue/PR if you see/want somethings.

Keywords

FAQs

Package last updated on 04 Jan 2019

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