DocsKitstarter for Etch
Rename BEM classes in Etch
Give Kitstarter layouts your own class names, before you insert them or once they're on the canvas.
Every Kitstarter layout comes with BEM classes named after it, like faq-14__heading. Kitstarter for Etch lets you swap that prefix for your own, before insert or later on the canvas.
Before you insert
- In the Kitstarter panel, click the pencil next to Insert on a card (its tooltip says Insert & rename BEM classes).
- In Rename BEM classes (Rename component for a component), type your own Class prefix.
- Check Detected elements. Edit an element's name to rename it, or use its skip button to keep its original class.
- Click Rename & insert.
If you haven't changed the prefix or any element name, the panel asks you to change at least one.
On the canvas
You can also rename a section that's already on your page, including one you inserted earlier.
- Right-click the section on the canvas or in the structure panel. You can also pick an element inside it to rename only that part.
- Choose Rename BEM classes…. It sits next to Etch's own Generate BEM Classes in the same menu.
- Type the new Class prefix and check Detected elements, skipping any you want to keep.
- Pick a mode, then click its button:
- Rename updates the class names on this section and renames the matching CSS to match.
- Create new creates new class names with copies of the CSS on this section. The original CSS stays in Etch's Style Manager, so other sections that use it don't change.
Skipping elements is handy when you've added hand-written classes you want to keep.
Sync label
Both dialogs have a Sync label switch. When it's on, element labels follow the new class names. For example, if you rename the class image to media, the block is labelled "Media" as well. It's on by default, and the panel remembers your choice in this browser.
Tips
- Class names are lowercase. Spaces and other characters become hyphens, so
My Herobecomesmy-hero. - Renaming works on Kitstarter's BEM classes. If a selection has no BEM block class, the plugin tells you to select the outer section that has them.
- Copying from the website? The site has its own rename. See Copy and paste into Etch.