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

Package detail

@stefanoruth/classnames

stefanoruth9MIT1.1.1TypeScript support: included

A simple classnames javascript utility function for combining conditional classnames together.

readme

Classnames

A simple classnames javascript utility function for combining conditional classnames together.

npm npm Build & Tests

Installation

# npm
npm install @stefanoruth/classnames

# Yarn
yarn add @stefanoruth/classnames

Example

import React from 'react
import { css } from '@stefanoruth/classnames'

export const Card = props => {
    return <div className={css('bg-white w-full shadow rounded', props.spacing && 'px-4 py-6' props.className)}>{props.children}</div>
}