1.0.0 • Published 3 years ago
@creattix-design/utils v1.0.0
Kreattix Design Utils
Basic Utility functions for Kreattix Design. As kreattix design don't have their own utilities, we are here to help you. You easily can use this library with kreattix design. It is also usable with vanilla javascript or any javascript framework.
Installation
using npm
$ npm install kreattix-design-utilsusing yarn
$ yarn add kreattix-design-utilsAs of now we only have functions to map classes based on the values provided, along with the functionality of adding prefix to the class.
Class Functions
mapClass(prefix, classlist, staticClasses(optional))
mapClass(
'kd',
{
class1: true,
class2: false
},
'static-class'
)
// result -> kd-class1 static-class
mapClass(
null,
{
class1: true,
class2: false
},
'static-class'
)
// result -> class1 static-class
mapClass('kd', 'class-as-string', 'static-class')
// result -> kd-class-as-string static-classParameters
| Parameter Name | Type | Default |
|---|---|---|
| prefix | string , null | -- |
| classlist | string , { [key: string]: boolean } | -- |
| staticClass | string | "" |
License
MIT
1.0.0
3 years ago