I decided to get completely rid of all ids in my CSS and in addition to that I want to begin transition to HTML 5.
Old Markup where .sidebar is the selector for both sidebars and the ID's are uses to style the sidebars individually
<div id="sidebar" class="sidebar widget-area"></div>
<div id="sidebar-alt" class="sidebar widget-area"></div>
now this is what I would do in html 4 and I am NOT under the impression that ID's are obsolete in HTML5 please to not upvote this comment I would have done the same in html 4
<div class="sidebar sidebar-primary widget-area"></div>
<div class="sidebar sidebar-secondary widget-area"></div>
My question is now about the role attribute. Is this basically a made up value? Has it or might have some real meaning in the future?
Solution 1 Where .sidebar stays the selector for both sidebars and I would uses aside[role="..."] to style the sidebars individually
<aside role="sidebar-primary" class="sidebar widget-area"></aside>
<aside role="sidebar-secondary" class="sidebar widget-area"></aside>
Solution 2 Or should I better give both sidebars the same role and use the role selector for common styles?
<aside role="sidebar" class="sidebar-primary widget-area"></aside>
<aside role="sidebar" class="sidebar-secondary widget-area"></aside>
I am not that into HTML 5 yet and I like to get some Opinions what might be better with in depth explanation if possible.
After looking at the WTC
list of roles the "sidebar" role seems not to be defined and after thing about it both solutions (1+2) might be bad
Solution 3
The "complementary" role is defined as a role by W3C so this might be a better way to do it? I am still curious why people come up with role="sidebar" then and what sense does it make to just "invent" roles? If its for CSS
they should uses classes to style or not?
<aside role="complementary" class="sidebar-primary widget-area"></aside>
<aside role="complementary" class="sidebar-secondary widget-area"></aside>