0.0.4 • Published 6 years ago

as-cn v0.0.4

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

as-cn

This small function allows you to manage class names

Mode 1

In this way, you can extract names of an object using the index, which has a definition check.

import {h}   from 'preact';
import cn    from 'as-cn';
import './style.css';

export default function(){
   return <div class={
           cn({
               box : true
           })
       }>
   </div>
}

// <div class="box"></div>

Mode 2

In this way you can extract names of a module by means of a parallel object that points to each property of the module object.

import {h}   from 'preact';
import cn    from 'as-cn';
import style from './style.css';

export default function(){
   return <div class={
           cn(style,{
               box : true
           })
       }>
   </div>
}
// <div class="box"></div>
0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago

0.0.0

6 years ago