Skip to content

Commit

Permalink
Add a role="main" for the <main> tag
Browse files Browse the repository at this point in the history
  • Loading branch information
kizu committed Jan 11, 2016
1 parent a4ac8ec commit e48887c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Expand Up @@ -6,6 +6,7 @@
- Added a way to redefine prefix on block/element level.
- Added a `flat_elements` setting to allow elements of elements.
- Add a `role="presentation"` for links with empty `alt`, via [Estelle Weyl](https://twitter.com/estellevw/status/685332992227540992).
- Add a `role="main"` for the `<main>` tag.
- `src`-less images now would have null gif inlined (or set to the given src).
- Changed the default way the tag is passed: using either a first uppercase class or an option object.
- Changed the settings to be a single object and not a bunch of variables.
Expand Down
3 changes: 3 additions & 0 deletions lib/bemto_tag.jade
Expand Up @@ -70,6 +70,9 @@ mixin bemto_tag(tag)
if !attributes.type
- attributes.type = "text"

if newTag == 'main'
if !attributes.role
- attributes.role = 'main'
if newTag == 'html'
<!DOCTYPE html>

Expand Down
2 changes: 2 additions & 0 deletions test/cases/1_basics.html
Expand Up @@ -10,6 +10,8 @@
</div>
<div class="block block_foo">bar
</div>
<main class="content" role="main">CONTENT
</main>
<div class="block block_foo block_bar block_baz">
<div class="block__element block__element_type_lol block__element_mode_moddy">Blah
</div>
Expand Down
2 changes: 2 additions & 0 deletions test/cases/1_basics.jade
Expand Up @@ -10,6 +10,8 @@ include ../../bemto

+b.block_foo bar

+b.MAIN.content CONTENT

+b.block_foo._bar._baz
+e.element_type_lol._mode_moddy Blah

Expand Down

0 comments on commit e48887c

Please sign in to comment.