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

Package detail

html-classnames

eskalacja107MIT1.0.0

JS HTML classnames helper

readme

HTML JS ClassNames helper

Simple, no-dependency helper for building BEM html classes.

Simple module, and simple readme.

How to use it?

Signature is as follows

/**
 * @param {string} baseName
 * @param {Object<string, boolean>} extras
 * @return {string}
*/
className(baseName, extras = {});

Example usage

const classNames = require('html-classnames');

const isBig = true;
const isLong = false;
const names = classNames('some-class', {
    '--is-big': isBig,
    '--is-long': isLong, 
});

console.log(names); // "some-class some-class--is-big"

How to install?

npm install html-classnames

or

yarn add html-classnames

Changelog

This repository is using semantic-release, so you can find nice changeglog in the CHANGELOG file.

Contributing

All contributions welcome. Feel free to start new issue or even create a PR right away!

changelog

1.0.0 (2020-09-20)

Features

1.0.0-beta.1 (2020-09-20)

Features