1.0.0 • Published 1 year ago

@creattix-design/utils v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Kreattix Design Utils

GitHub license npm version

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 NameTypeDefault
prefixstring , null--
classliststring , { [key: string]: boolean }--
staticClassstring""

License

MIT