I added this to my subtheme & it's quite a good way to cover some very basic accessibility issues.

http://openconcept.ca/blog/mgifford/adding-css-markup-detective-drupal

I think this could be easily added into genesis as a quick accessibility review tool. This doesn't mean your theme will be accessible, but will remind users about alt tags and what not.

Comments

Jeff Burnz’s picture

That looks pretty cool Mike, I tested out your site and checked the license (GPL from what I can see) so it could actually be included, something to think about.

mgifford’s picture

I extended it a bit further by allowing it to be turned off in a setting by:

stuffing this into the theme-settings.php

<?php

function genesis_SUBTHEME_form_system_theme_settings_alter(&$form, &$form_state)  {
  $form['theme_settings']['holmes'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable Holmes CSS'),
    '#default_value' => theme_get_setting('holmes'),
    '#description'   => t("Look for accessibility problems in your HTML."),
  );
}

providing a default state in genesis_SUBTHEME.info

  settings[holmes] = 1

And then watching for the variable in template.php

/**
 * Override or insert variables into the html templates.
 */
function genesis_SUBTHEME_preprocess_html(&$vars) {
  // if a user then add CSS warnings for known accessibility issues
  if (user_access('access administration pages') && theme_get_setting('holmes')) { 
    drupal_add_js('jQuery(function ($) { $(document.body).addClass("holmes-debug") });', array('type' => 'inline', 'weight' => 9));
    drupal_add_css(path_to_theme() . '/css/holmes.css', array('weight' => CSS_THEME, 'preprocess' => FALSE));
  } 
}

Would be a neat thing to doublecheck for simple accessibility problems.

mgifford’s picture

Status: Active » Postponed

It may be better to put this into a module, there's an effort to do this here:
#1254482: holmes

mgifford’s picture

Issue summary: View changes
Status: Postponed » Closed (won't fix)

Probably better to do this as a module...