Skip to content
/ as-cn Public

🎁 This small function allows you to manage class names

License

Notifications You must be signed in to change notification settings

UpperCod/as-cn

Repository files navigation

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>

About

🎁 This small function allows you to manage class names

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published