Module: Well

Defined in:
lib/well.rb,
lib/well/dsl.rb,
lib/well/block.rb,
lib/well/config.rb,
lib/well/element.rb,
lib/well/version.rb,
lib/well/component.rb

Overview

Well is a BEM DSL for ActionView. It helps you to keep your view code clean when dealing with complex BEM classes.

Examples:

This view code…

<%= block :div, 'container' do %>
  Text
  <%= element :p, 'foreword' do %>
    More text
  <% end %>
<% end %>

…produces this HTML.

<div class="container">
  Text
  <p class="container__foreword">
    More text 
  </p>
</div>

Modifiers result in two classes being added to the HTML tags.

<%= block :div, 'container', modifier: 'red' do %>
  Text
  <%= element :p, 'foreword', modifier: 'small' do %>
    More text
  <% end %>
<% end %>

<div class="container container--red">
  Text
  <p class="container__foreword container__foreword--small">
    More text 
  </p>
</div>

Author:

Defined Under Namespace

Modules: Component, DSL Classes: Block, Config, Element

Constant Summary collapse

VERSION =
'0.1.0'

Class Method Summary collapse

Class Method Details

.configConfig

Allows access to the Config singleton object.

Returns:


20
21
22
# File 'lib/well/config.rb', line 20

def self.config
  Config.instance
end