-
Notifications
You must be signed in to change notification settings - Fork 0
/
use-bem.ts
25 lines (23 loc) · 838 Bytes
/
use-bem.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Generated by `{{MODULE_NAME}}`
import { useBemFactory } from '{{MODULE_NAME}}/use-bem-factory';
/**
* Function to create classes according to the BEM methodology for a BEM block with the specified `name`.
* If `name` is not specified or `null`, the name of the component where the composable is called will be used (if possible to define).
*
* @example
* const b = useBem('block');
* b(null); // block
* b('element', { modifier: true }); // block__element block__element--modifier
* @example
* <script setup>
* defineOptions({ name: 'the-block' });
*
* const b = useBem();
* b('element'); // the-block__element
* </script>
*
* @param name BEM block name.
*
* @returns Function to create classes according to the BEM methodology.
*/
export const useBem = useBemFactory({{OPTIONS}});