8000 GitHub - andrew4699/classnames: Simple utility for conditionally joining HTML class names together (based on JedWatson/classnames)
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Simple utility for conditionally joining HTML class names together (based on JedWatson/classnames)

License

Notifications You must be signed in to change notification settings

andrew4699/classnames

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

classnames

Simple utility for conditionally joining HTML class names together (based on JedWatson/classnames)

Install

go get github.com/andrew4699/classnames

Usage

Note that classnames.B is shorthand for classnames.Build

...

import (
    "github.com/andrew4699/classnames"
)

classnames.B("foo", "bar") // "foo bar"
classnames.B([]string{"foo", "bar"}, "duck") // "foo bar duck"
classnames.B(nil, "foo", []string{"bar"}, nil, nil, nil) // "foo bar"

myMap := classnames.Map{
    "foo": true,
    "bar": false,
    "duck": true,
}

classnames.B(myMap) // "foo duck"

...

About

Simple utility for conditionally joining HTML class names together (based on JedWatson/classnames)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0