Results 1 to 25 of 31
Apr 21, 2012, 12:03 #26
- Join Date
- Jul 2006
- Augusta, Georgia, United States
- 16 Post(s)
- 3 Thread(s)
So I think the consensus here seems to be that the repetitive data-fapi- prefix adds a lot of extra mark-up for little in return besides for avoiding conflicts imposed by other third part extensions.
So the approach should changed from this:
<div data-fapi-textfield data-fapi-name="first_name" data-fapi-widget="text" data-fapi-element> ... </div>
<div class="element textfield name-first_name widget-email"> ... </div>
The only problem I have with this is that any third party CSS that uses selectors .element, .textfield, etc without a more specific context would be applied. This would not be good. Which is why the initial data-api- prefix was applied. I will admit though the multiple class method is a lot less mark-up.
I guess the solution to preventing similar selector conflicts would be to add the prefix back in like this:
<div class="fapi-element fapi-textfield fapi-name-first_name fapi-widget-email"> ... </div>
decisions decisions…The only code I hate more than my own is everyone else's.