Skip to content

lsongdev/cls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cls-str cls-str

A super tiny class serializer

Installation

$ npm install cls-str

Example

import cls from 'cls-str';

cls({ foo:true, bar:false, baz: isTrue() });
//=> 'foo baz'

cls('form-field', { success:  1 > 0 }, [ 'color-whilte', 'bg-black' ], 'dup', 'dup', null);

//=> 'form-field success color-whilte bg-black dup'
import React from 'react';
import cls from 'cls-str';

const TodoItem = ({ text, isDone, disabled }) => (
  <li className={ cls({ item:true, completed:isDone, disabled }) }> 
    <input type="checkbox" disabled={ disabled } checked={ isDone } />
    <label>{ text }</label>
  </li>
);

Contributing

  • Fork this Repo first
  • Clone your Repo
  • Install dependencies by $ npm install
  • Checkout a feature branch
  • Feel free to add your features
  • Make sure your features are fully tested
  • Publish your local branch, Open a pull request
  • Enjoy hacking <3

MIT

This work is licensed under the MIT license.


About

A super tiny class serializer

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published