Adding a class to the  tag of a menu I need to put a class/ID on the actual li element as each link in the menu has a color-coded background when active meaning, I can't just style ".active-trail" as that will be the same color for every link.

Creating a menu and using the CSS ID or class puts the ID/class on the a element, not on the &lt;li&gt; tag.

I could write something in jQuery, but I thought there might be a way in Drupal.

The output I want would be like the following.

&lt;li class="leaf myCustomClass active-trail"&gt;&lt;a href="/trash-this" class="active" title=""&gt;Test links&lt;/a&gt;&lt;/li&gt;
&lt;li class="leaf myCustomClass"&gt;&lt;a href="http://#" class="specialMenuItem first" title=""&gt;first&lt;/a&gt;&lt;/li&gt;
&lt;li class="leaf myCustomClass"&gt;&lt;a href="http://#" class="specialMenuItem" title=""&gt;second&lt;/a&gt;&lt;/li&gt;
You need to use theme_menu_item_link()

The following is an example that I pulled from an old site:

function THEME_menu_item_link($link)
{
    if (empty($link['localized_options']))
    {
        $link['localized_options'] = array();
    }

    //Give this menu item a unique id
    $link['localized_options']['attributes']['id'] = 'menu-item-' . $link['mlid'];

    //Not sure if this is the cleanest method, but it should allow us to follow
    //the active-trail across menu items, based on path.

    //Get the start of the current path (e.g. admin/build/modules would be admin)
    $base_path = preg_replace('/^([A-Za-z0-9_-]+)\/(.*)/', '${1}', drupal_get_path_alias($_GET['q']));

    //Get the current link we're looking at
    $this_link = drupal_get_path_alias($link['href']);

    //If the
   if($base_path == $this_link)
   {
       $link['localized_options']['attributes']['id'] = 'menu-active-trail-' . $link['mlid'];
   }

   return l($link['title'], $link['href'], $link['localized_options']);
}