I am using Drupal's hook_form_alter
to add a stylesheet into one of my forms (user registration form). My code does add the stylesheet to jquery.extend(Drupal.settings)
as sites\/all\/themes\/mytheme\/css\/font-awesome-min.css:1
, but this does not allow me to use the stylesheet as when I reference classes that are in it, they don't load as the CSS file does not show up as an import URL or link in <head>
. Any help would be appreciated.
function mytheme_form_alter(&$form, &$form_state, $form_id) {
if ( $form_id == 'user_register_form' )
{
$form['#attached']['css'] = array(drupal_get_path('theme', 'mytheme') . '/css/font-awesome-min.css');
}