Since the field wrappers were removed (see #2140663: Flexslider fields does not contain field tpls due to code revert from alpha2) there are few options for distinctly styling flexsliders, especially if there are multiple on a page (see #1866740: Impossible to have two+ sliders on same page regarding to the size of image).
Targeting flexslider-ID does not cut it when the flexsliders are optional. (Who knows which one #flexslider-1 will be?)
Others besides me are looking for more CSS options (see #1948244: Enhance CSS namespace styling).
I propose adding the name of the optionset and the name of the image style each as classes on the flexslider container div. This will give users more flexibility when styling flexsliders.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | flexslider-add_classes-2458899-3.patch | 1.14 KB | das-peter |
Comments
Comment #1
tommyk commentedThis patch adds the optionset name and the image style name as classes on the flexslider container div.
Comment #2
tommyk commentedComment #3
das-peter commentedExactly what I was looking for - however I suggest to use
drupal_clean_css_identifier()to get proper css classes and be more defensive with$settings['image_style']as this isn't necessarily available all the time.Updated patch attached.
Comment #4
jenlamptonA good improvement, and works as described. Thanks! :)
Comment #5
minoroffense commentedI'm ok with the patch. But I'm pretty sure with the latest build that image style is always blank (the option set doesn't store the stud anymore).
Comment #6
minoroffense commentedMinor adjustment. Going to run it through drupal_html_class() instead to ensure it gets lowercased.
Patch applied.