0.1.3-alpha.1 • Published 7 years ago

@hrgui/classy-components v0.1.3-alpha.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

@hrgui/classy-components

This is a forked copy of sk22/classy-components. Please see for original changes and manual.

This has a couple of additional bugfixes and additional features described below, and is under the @hrgui alias.

Installation

yarn install @hrgui/classy-components

Bugfixes

Standard function notation

const Button = classy.button('btn');
// => <button class="btn">

const PrimaryButton = classy(Button)('btn-primary');
// => <button class="btn btn-primary">

would return b t b t previously. Now it returns btn btn-primary

Additional features

Created component can have props.className as an added class

Before:

const Button = classy.button('btn');
// => <button class="btn">
<Button className="hello"></Button>
// => <button class="hello">

After:

const Button = classy.button('btn');
// => <button class="btn">
<Button className="hello btn"></Button>
// => <button class="hello btn">

Interpolation through tagged literals w/ functions (combines features from @memphju/classed-components)

const Button = classy.button`green ${props => props.className}`

<Button className="hello btn"></Button>
// => <button class="green hello btn">

References

0.1.3-alpha.1

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago