Last active
August 29, 2015 14:08
-
-
Save Johnius/f4b3dbf7d01d10382ef5 to your computer and use it in GitHub Desktop.
BEM true-way for Haml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/views/blocks/header.haml | |
- b 'header', attrs: { title: "Header title" } do |b| | |
- e 'title', tag: 'h1', content: 'Title example' | |
- e 'subtitle', tag: 'h3', content: 'Subtitle here' | |
/views/index.haml | |
= b 'header' | |
/ Result | |
.b-header{title: "Header title"} | |
%h1.b-header__title Title example | |
%h3.b-header__subtitle Subtitle here | |
/views/test.haml | |
= b 'header' | |
= e 'title' do | |
= 'test' | |
/Result | |
.b-header{title: "Header title", onClick: "javascript:void(0)"} | |
%h1.b-header__title test | |
%h3.b-header__subtitle Subtitle here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment