class-func-style

1.0.0 • Public • Published

Class Func Style

child of classnames library https://github.com/JedWatson/classnames by JedWatson

utility for classNames and functional/utility css styling

npm

npm install class-func-style --save

yarn

yarn add class-func-style

Output

This function always return className: 'strings of style' when invoke with a truthy argument.

To Use

let listOfFuncCSS = classFuncStyle({
  'HeaderBackground':'bg-black'
})

listOfFuncCSS('HeaderBackground') // -> {className:'bg-black'}
listOfFuncCSS({
  'HeaderBackground':true  // -> {className:'bg-black'}
})
listOfFuncCSS(['HeaderBackground']) // -> {className:'bg-black'}

// it also accepts non-declared value as long as it was invoke first
let funcStyle = classFuncStyle()
funcStyle('btn',{'btn-error':false}) // -> {className:'btn'}

Motivation in writing

Finding better workflow in using a functional/utility style of css writing.


Package Sidebar

Install

npm i class-func-style

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

5.1 kB

Total Files

5

Last publish

Collaborators

  • vdbx