I thought I could add my theme's css to the Dialog module through hook_library_alter but it doesn't seem so except something is wrong in my function.
/*
* Implements hook_library_alter().
*/
function mycustom_library_alter(&$libraries, $module) {
// Register libraries on behalf of mytheme.theme.
$libraries['mytheme.drupal.dialog'] = array(
'title' => 'mytheme Drupal Dialog',
'website' => 'http://www.drupal.org',
'version' => VERSION,
'css' => array(
drupal_get_path('module', 'dialog') . '/themes/mytheme/css/components/buttons.css' => array(),
drupal_get_path('module', 'dialog') . '/themes/mytheme/css/components/ui-dialog.css' => array(),
),
'dependencies' => array(
array('dialog', 'classy.drupal.dialog'),
),
);
global $theme;
// Alter libraries on behalf of mytheme.theme.
if ($theme == 'mytheme') {
// Replace the default dialog theme CSS with custom CSS for igr_omega.theme.
if ($module == 'dialog' && isset($libraries['drupal.dialog'])) {
$path = drupal_get_path('module', 'dialog') . '/js/dialog/dialog.theme.css';
unset($libraries['drupal.dialog']['css'][$path]);
$libraries['drupal.dialog']['dependencies'][] = array('dialog', 'mytheme.drupal.dialog');
}
}
}
Nothing happens, all css are taken from the default 'base' jquery.ui theme. I can not see what is wrong here or is there an other way to declare my theme ?
Comments