I have a custom form element (http://drupal.org/project/jslider_field) that uses #attached to attach js,css files
It uses jqueryui slider plugin.
When it's used in a normal form everything is fine and the custom override css that comes with the element includes after the jquery ui theme.
However when it's used in an ajax form and is loaded via ajax, jquery ui theme is included after the custom override css therefore it's no longer possible to override jquery ui css.
I tried assigning weight but nothing changed
<?php
$element['slider']['container'] = array(
'#type'=> 'container',
'#attributes'=> array('class'=> array('jslider-container', $element['#slider_style']), 'style'=> $style),
'#attached'=> array(
'library'=> array(
array('system', 'ui.slider')
),
'js'=> array(
drupal_get_path('module', 'jslider_field') . '/jslider_field_jslider.js',
array(
'data'=> array(
'jslider_field_'. $element['#id'] => array(
'animate'=> $element['#animate'],
'disabled'=> $element['#disabled'],
'max'=> $element['#max'] * 1,
'min'=> $element['#min'] * 1,
'orientation'=> $element['#orientation'],
'range'=> $element['#range'],
'step'=> $element['#step'] * 1,
'display_inputs'=> $element['#display_inputs'],
'display_values_format'=> $element['#display_values_format'],
'display_values'=> $element['#display_values'],
'group'=> $element['#group'],
'group_type'=> $element['#group_type'],
'group_master'=> $element['#group_master']
)
),
'type'=> 'setting',
)
),
'css'=> array(
array(
'data'=> drupal_get_path('module', 'jslider_field') . '/jslider_field_jslider.css',
'type'=> 'file',
//'group' => CSS_SYSTEM,
'weight'=> 2000,
)
),
),
'#markup'=> '',
'#suffix'=> '</div>'
);
?>