How to add first and last classes to local task items? I'd like to add some classes to local task items, now there is only "active" class available which is pretty not flexible, I'd like to have "first" on first item and "last" on last item.

Tried theme_menu_local_tasks() and theme_menu_local_task(), neither of them work. And the post about "Add first and last classes to secondary local tasks" is probably for Drupal 6 so it's not working either.
You can use jQuery :first and :last selectors, example:

$('ul li:first').addClass(‘first’);
$('ul li:last’).addClass(‘last’);


Or you can use CSS :first-child and :last-child selectors, example:

li:first-child { add your css here }
li:last-child { add your css here }


The CSS way will give better performance.