JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 25
  • Score
    100M100P100Q63675F
  • License MIT

a typescript-starter project

Package Exports

  • classifizer

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (classifizer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

classifizer

Build complex conditional classes and stylize them with injected css-modules

NPM JavaScript Style Guide

Install

npm install --save classifizer

or

yarn add classifizer

Usage

import React from 'react'
import {
  classes,
  styledClasses,
  stringStylizer,
} from 'classifizer';

import * as styles from './Example.css';

const stylizeString = stringStylizer(styles);
const stylizeClasses = classesStylizer(styles);

export function Example({ isChecked }) {
  return (
    <>
      <div className={classes(styles['checkbox'], isChecked && styles['checkbox_active'])}>

      <div className={styledClasses(styles, 'checkbox', isChecked && 'checkbox_active')}>

      <div className={stylizeString(classes('checkbox', isChecked && 'checkbox_active'))}>

      <div className={stylizeString('checkbox checkbox_active')}>

      <div className={stylizeClasses(checkbox: { use: true, mod: { active: isChecked } })}>
    </>
  );
}

export default Example;

More examples of using inner classBuilder you can find in tests

License

MIT © sam0sva1