1.0.0 • Published 1 year 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-utils
using yarn
$ yarn add kreattix-design-utils
As 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-class
Parameters
Parameter Name | Type | Default |
---|---|---|
prefix | string , null | -- |
classlist | string , { [key: string]: boolean } | -- |
staticClass | string | "" |
License
MIT
1.0.0
1 year ago