BEM methodology

Amazium uses the BEM (Block Element Modifier) methodology to create a consistent and scalable CSS architecture. This approach ensures clear structure, predictable naming, and easier maintenance across components.

Blocks, Elements & Modifiers

BEM organizes styles into blocks, elements, and modifiers, each with a specific role in structuring and extending UI components.

  1. Block

    Blocks are standalone components that define reusable parts of the interface. Each block represents a distinct piece of UI and can be used independently or alongside other blocks.

    <div class="block">...</div>
  2. Element

    Elements are parts of a block that depend on their parent for context. They cannot be used independently and are always scoped to a specific block.

    <div class="block">
      <div class="block__element">...</div>
    </div>
  3. Modifier

    Modifiers are used to adjust the appearance or state of a block or element, allowing variations without changing the core structure.

    <div class="block block--modifier">...</div>

Naming Rules

Blocks use `.block`, elements use `.block__element`, and modifiers use `.block--modifier`. Names should be lowercase and use hyphen separation for readability.


All together

Blocks, elements, and modifiers work together to create flexible and maintainable components. The example below shows how a card component is structured using BEM naming conventions.

Card - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

<div class="card card--width-half">
  <div class="card__body">...</div>
</div>
  1. Foundations
  2. Foundations: Color