Re: [csswg-drafts] Please add "tab-index" to CSS specification

I agree that needing to add IDs to everything I want to change the tab order on would be a gigantic pain. I almost might as well add tabindex attributes, if I have to change markup anyway. I would consider this a non-starter. 

>you need to be aware of all elements on the page to pick your number correctly,

That could mostly be taken care of with a reset, like this:

input, a, select, textarea, button, iframe { tab-index: 100; }

Which would be way easier than the current situation with tabindex attributes. But even so, it is not ideal for when you wanted to change the order within one limited area, without having to type in numbers for everything after that. 

It would be better, if we could isolate a group of elements to set tab order on. Something like this, maybe:

fieldset { tab-index-group: isolate; }
fieldset input  { tab-index: 2; }
fieldset input:first-of-type { tab-index: 3; }
fieldset input:last-of-type { tab-index: 1; }

The result of that would be that the tab-index values would only affect elements within that container. 

PS: even if it was only being able to set tab-index 0 and -1 values via CSS, that would be huge by themselves. 

And having a 'none' value would also be cool, if it was like 'pointer-events:none', but also would stop propagation of focusing to items below it in the z direction. 




-- 
GitHub Notification of comment by bradkemper
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1748#issuecomment-325258871 using your GitHub account

Received on Monday, 28 August 2017 04:43:45 UTC