styling-bem-layout

Applies shared BEM layout blocks to Angular screens using rtBlock and rtElem directives.

1|Updated Jan 14, 2024
One-click install
npx skills add https://github.com/Eyhenij/rt-tools --skill styling-bem-layout-eyhenij
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: styling-bem-layout
Source: https://github.com/Eyhenij/rt-tools/tree/main/.claude/skills/styling-bem-layout
Command: npx skills add https://github.com/Eyhenij/rt-tools --skill styling-bem-layout-eyhenij

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Screens that each declare their own layout styles drift apart visually — the same page title ends up in eleven components at three different font sizes. This Skill enforces a pattern where layout is declared once in the application's shared style layer and screens only apply it via BEM directives. ## Core Features & Use Cases - Shared layout blocks: Apply predefined blocks like <prefix>-page, <prefix>-form, <prefix>-panel, <prefix>-window, and <prefix>-site-page to section screens, forms, panels, and modal dialogs. - BEM markup via directives: Use rtBlock at the template root and rtElem on child elements so class names are generated consistently without hand-written BEM strings. - Foreign subtree elements: Combine rtBlock and rtElem on one element to place your own element inside another block's subtree. - Use Case: When building a bookings admin screen, set host: { class: '<prefix>-page' }, wrap the template in <ng-container rtBlock="<prefix>-page">, and mark up the header, title, and hint with rtElem — no layout CSS in the screen's style file. ## Quick Start Ask the AI to assemble a new section screen or form using the shared layout layer with rtBlock and rtElem instead of writing layout styles in the component's style file.

Frequently Asked Questions about styling-bem-layout

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I apply BEM layout to an Angular screen with rtBlock?

Set the block class on the component host, then wrap the template in an ng-container with rtBlock naming the block. Child elements receive their classes through rtElem, which generates names like prefix-page__title automatically.

What layout blocks are available in the shared style layer?

The shared layer provides blocks for page, form, panel, and window layouts, plus a site-page block for content columns. Each block handles a specific container type such as section screens, card-section forms, edit panels, or modal dialogs.

Why does rtElem fail at runtime without a build error?

rtElem requires an ancestor element carrying rtBlock to resolve the block name. Without that ancestor, rendering fails at runtime while the build and lint stay silent, so always verify the template root declares rtBlock.

Can I add my own element inside a foreign BEM block subtree?

Yes, place both rtBlock and rtElem on the same element. The block class is not set on that node; only the element class is generated, and descendants count from the block you named.

When should layout styles stay in a screen's own style file?

Only styles unique to that one screen belong in its file, such as a calendar grid, a map, or a conversation feed. Add a comment explaining why the style is not shared, and keep flex layout and padding in the shared layer.