kna / bem-bundle
BEM classes generation helper
Installs: 513
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.2
- symfony/framework-bundle: ^4.0|^5.0
Requires (Dev)
- symfony/console: ^4.0|^5.0
- symfony/phpunit-bridge: ^4.0|^5.0
- symfony/twig-bundle: ^4.0|^5.0
- symfony/yaml: ^4.0|^5.0
- twig/twig: ^3.0
Suggests
- twig/twig: For using template helpers
This package is auto-updated.
Last update: 2024-12-29 05:59:56 UTC
README
This bundle provides helpers for BEM classes generation.
Installation
composer require kna/bem-bundle
Configuring
kna_bem:
block_function_name: b #default
Usage
{# templates/base.html.twig #}
<div class="{{ b('card').m('color', 'red') }}">
<div class="{{ b('card').e('title') }}">Title</div>
<div class="{{ b('card').e('content').m('hidden').addClass('no-js') }}">Some content</div>
</div>
Running tests
docker-compose run --rm php ./vendor/bin/simple-phpunit