// readme

ember-bem-helpers

This addon provides BEM helpers for Ember.js applications.

This addon produces BEM classes based on Two Dashes style.

No mixins, no code in the component js/ts file needed. Works with template-only components.

Compatibility

  • Ember.js v6.4 or above
  • Embroider or ember-auto-import v2

Installation

ember install ember-bem-helpers

Configuration for V2 Addons

If you’re using this addon within a V2 addon (not a classic Ember app), you need to manually configure the AST transform in your addon’s babel.publish.config.cjs and/or babel.config.cjs:

module.exports = {
  plugins: [
    [
      'babel-plugin-ember-template-compilation',
      {
        targetFormat: 'hbs',
        transforms: [
          'ember-bem-helpers/ast-transform',
          // ... other transforms
        ],
      },
    ],
    // ... other plugins
  ]
}

This is necessary because v2 addons are pre-built, so the AST transformation needs to happen during the addon’s own build process, not in the consuming app.

Note: Classic Ember apps and Embroider apps…