1.1.0 • Published 6 months ago

@vexip-ui/bem-helper v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

BEM Helper

Help you quickly get various BEM names and values.

Install

pnpm i @vexip-ui/bem-helper

Usage

Without namespace:

import { useBEM } from '@vexip-ui/bem-helper'

const bem = useBEM('button')

bem.b() // button
bem.be('icon') // button__icon
bem.bm('active') // button--active
bem.bem('icon', 'active') // button__icon--active
bem.cb() // .button
bem.cv('color') // --button-color

With namespace:

import { useBEM } from '@vexip-ui/bem-helper'

const bem = useBEM('button', 'vxp')

bem.b() // vxp-button
bem.be('icon') // vxp-button__icon
bem.bm('active') // vxp-button--active
bem.bem('icon', 'active') // vxp-button__icon--active
bem.cb() // .vxp-button
bem.cv('color') // --vxp-button-color

Methods

You can view the definition of types. There are detailed comments in this file.

License

All in MIT license.

1.1.0

6 months ago

1.0.1

8 months ago

1.0.0

11 months ago