WooCommerce Product Filter CSS Customization: Skins, Titles, Fixes
WooCommerce product filter CSS customization usually starts with one small wish: checkboxes in the brand colour, smaller titles, a drop-down that matches the theme, or a fix for a theme that draws a second box next to every checkbox. HUSKY covers part of this with settings, and the rest takes a few lines of CSS once you know where to put them and which classes to target. This guide gives both, plus the fixes for the theme conflicts we see most often.
Settings first, then CSS
The Design tab (WooCommerce → Settings → Products Filter → Design) changes the look without code:
- Radio and checkboxes skin: the flat, minimal and square skins in ten colours, or none for the browser's own boxes.
- Drop-down skin: Native, Chosen or SelectWoo.
- Range-slider skin for the ion range-slider, Use tooltip and Tooltip icon, the toggle and more/less images, and the loading overlay.
Everything else goes into Advanced → Code → Custom CSS code. HUSKY prints that code right after its own stylesheet on every page where it loads, and keeps it in its settings, so plugin updates do not touch it. Paste plain CSS rules only: HTML tags such as <style> are stripped when the settings are saved, and backslashes are not kept reliably, so write a symbol directly (content: "✓") instead of a CSS escape like \2713. The theme's Additional CSS in the Customizer or a child theme stylesheet works just as well. Never edit the plugin's css/front.css: the next update replaces it.
Custom front css styles file link at the end of the Design tab is a different tool. It loads your file instead of front.css, not in addition to it, so use it only for a complete rewrite that starts from a copy of the plugin's file.
Making your rules win
Theme stylesheets often load after the plugin and use long selectors, and a few plugin rules carry !important. Start every rule with .woof, or body .woof when the theme still wins, and add !important only where the plugin or theme already uses it. To style one filter and leave the others alone, give it an ID with the sid attribute: [woof sid="sidebar"] adds the class woof_sid_sidebar to the form. Keep the ID to one word without spaces. Three IDs come with ready styles in the plugin's stylesheet: flat_grey, flat_dark and flat_white. The widget always uses woof_sid_widget. The automatic filter above the products takes its classes from its skin setting: woof_sid_auto_shortcode with the Default skin, and woof_sid_flat_grey plus woof_auto_2_columns with the flat grey skin a new install starts with; inspect the form to see which one your site uses.
The class map
| Element | Selector |
|---|---|
| Whole filter form | .woof, .woof_sid_<sid> |
| One filter block | .woof_container, by type .woof_container_checkbox, .woof_container_radio, .woof_container_select; by taxonomy .woof_container_product_cat, .woof_container_pa_color |
| Block title | .woof_container_inner h4 |
| List and items | .woof_list, .woof_list li; subcategories .woof_childs_list |
| Checkbox, label, count | input.woof_checkbox_term, .woof_checkbox_label, .woof_checkbox_count; selected .woof_checkbox_label_selected |
| Radio button and label | input.woof_radio_term, .woof_radio_label |
| Label buttons | .woof_list_label .woof_label_term, selected .woof_label_term.checked |
| Native drop-down | select.woof_select |
| Filter and Reset buttons | .woof_submit_search_form_container button, .woof_submit_search_form, .woof_reset_search_form |
The browser's inspector (right-click an element, Inspect) shows the exact classes of your filter and which rule wins. The CSS used on the demo site is a good source of ready examples.
Checkboxes and radio buttons: colour, size and sharpness
The flat, minimal and square skins draw each box from a small image sprite: one picture holds the unchecked, checked and disabled states side by side, and CSS shows the right part of it. Two consequences: CSS cannot recolour the box, and changing its width, height or scale shows neighbouring states or makes it blurry and pixelated. Pick the skin colour closest to your design, or switch to the browser's boxes.
For a brand colour or a larger box, set Radio and checkboxes skin to none and style the native inputs. accent-color colours them in all current browsers:
/* Skin "none": colour and size of the browser's own boxes */
.woof .woof_list input.woof_checkbox_term,
.woof .woof_list input.woof_radio_term {
accent-color: #1f7a4d;
width: 18px;
height: 18px;
}
If the boxes keep the theme's look after this, the theme restyles every checkbox on the site; see the theme conflicts section below. If you keep a skin, you can still replace its sprite with a recoloured copy of the same layout (the images are in the plugin's js/icheck/skins/ folder) through a background-image rule on the skin's class, for example .woof .icheckbox_flat-blue. For fully custom elements without CSS, the Smart Designer extension builds checkbox, radio and switcher designs in the admin; see how to create your own filter element.
Plain boxes flash before the skin appears
Skins are applied by JavaScript after the page loads, so for a moment the browser's own boxes are visible. Delayed JavaScript from an optimization plugin makes that moment longer; see JavaScript optimization and the filter. With any skin other than none, hide the inputs until the skin wraps them:
/* Only with a skin other than "none": hide inputs until the skin wraps them */
.woof .woof_list li > input.woof_checkbox_term,
.woof .woof_list li > input.woof_radio_term {
visibility: hidden;
}
The skin moves each input into its own box element, so the rule stops matching as soon as the skin is ready. With the skin set to none it would hide the boxes for good, so do not use it there.
Long labels, spacing and label buttons
The plugin displays each label as an inline block next to its box. When a category or attribute name is longer than the line, the whole label drops below the checkbox. Use one of these two fixes, depending on the look you want:
/* A: the text starts next to the box and wraps underneath it */
.woof .woof_list label {
display: inline !important;
}
/* B: the text stays in its own column next to the box */
.woof .woof_list label {
max-width: calc(100% - 35px);
vertical-align: top;
}
Adjust 35px to the width of your boxes. For spacing, the plugin gives each block 5 px of bottom padding and 9 px of bottom margin, and each label 4 px of padding above and below:
/* Tighter filter: less space between blocks and between items */
.woof .woof_container {
margin-bottom: 4px;
padding-bottom: 0;
}
.woof .woof_list label {
padding-top: 2px;
padding-bottom: 2px;
}
.woof .woof_checkbox_count {
margin-left: 6px;
color: #888;
}
For the label type (terms as buttons), the plugin sets a light grey box and a blue hover and selected state. Equal widths and your own colours:
.woof .woof_list_label .woof_label_term {
min-width: 60px;
}
.woof .woof_list_label li .woof_label_term:hover,
.woof .woof_list_label li .woof_label_term.checked {
background-color: #1f7a4d;
border-color: #1f7a4d;
}
Subcategory indentation and collapsing are covered in collapsible category trees.
Titles: font, size and heading tag
Block titles are h4 elements inside .woof_container_inner, the price filter title included, so they inherit the theme's h4 style:
.woof .woof_container_inner h4 {
font-family: inherit;
font-size: 15px;
font-weight: 600;
text-transform: none;
margin-bottom: 6px;
}
For a different tag, for example to fit the heading outline of your page, use the woof_title_tag filter. Return p or span if the titles should not be headings at all:
/*
* HUSKY: print filter block titles as <h3> instead of <h4>.
* Child theme functions.php or a code snippets plugin.
*/
add_filter('woof_title_tag', function ($tag) {
return 'h3';
});
Rules written for h4 then stop applying: the plugin's own margin, the title styles of the built-in flat_grey and flat_dark filter IDs, and your own CSS. Rewrite them for the new tag, for example .woof .woof_container_inner h3.
The heading above the whole widget is different. In a theme sidebar it uses the widget title markup the theme defines for all widgets; woof_widget_title_tag (default h3) applies only when the widget is printed without that markup. To change the texts of titles rather than their style, see how to rename filter titles.
Drop-downs: Native, Chosen or SelectWoo
When a theme's styles clash with the drop-downs (cut-off text, misplaced tags in multi-selects, wrong colours), switch Drop-down skin before writing CSS. Each skin is a different library, and the clash often disappears with another one. Snippets that use the woof_use_chosen filter no longer change anything; the setting decides.
- Native: the browser's
select, styled by your theme. Target.woof select.woof_select. - Chosen: the box is
.chosen-containerwith.chosen-single(single) or.chosen-choices(multiple), and the open list.chosen-results lisits inside the filter, so.woofscopes everything. - SelectWoo: the box is
.select2-containerinside the filter, but the open list is attached to the end of the page. Rules for.select2-dropdowncannot be scoped with.woofand also affect other SelectWoo fields, such as the country field at checkout.
/* Chosen: closed box and open list */
.woof .chosen-container-single .chosen-single {
text-align: left;
background: #fff;
border-color: #ccc;
border-radius: 4px;
}
.woof .chosen-container .chosen-results li {
font-size: 15px;
color: #222;
}
Tooltips
The info icon next to a block title opens the text from the block's Tooltip option on click. It uses the Tooltipster library with its noir theme:
.tooltipster-sidetip.tooltipster-noir .tooltipster-box {
background: #fff;
border: 1px solid #ddd;
border-radius: 6px;
}
.tooltipster-sidetip.tooltipster-noir .tooltipster-content {
color: #333;
font-size: 14px;
}
Empty tooltip boxes, or tooltips elsewhere on the site turning into grey squares, mean another script on the page uses the same or a clashing tooltip library (reported with the Flatsome theme and with product badge plugins). Set Use tooltip to No on the Design tab; the info icons then disappear from the filter.
The names that appear over colour and image swatches are plain CSS (p.woof_tooltip span.woof_tooltip_data). If such a name covers the neighbouring swatch and catches its clicks, let clicks pass through it:
.woof p.woof_tooltip span.woof_tooltip_data {
pointer-events: none;
}
Theme conflicts: double boxes, hash marks and alignment
Many themes style every list, label and checkbox on the page, the filter included. Inspect the stray element to find the theme rule, then switch it off inside .woof only.
- Two boxes per item. The theme draws its own checkbox with a pseudo-element on labels. HUSKY's lists do not use pseudo-elements, so it is safe to remove them there:
.woof .woof_list label::before, .woof .woof_list label::after { display: none !important; } - Hash marks, arrows or icons before items. A theme rule for widget lists adds content before each
li:.woof .woof_list li::before { content: none !important; } - A bullet next to the whole widget. The theme prints widgets as list items:
li.WOOF_Widget { list-style: none; }. - Centred or cut-off fields.
body .woof .woof_redraw_zone { text-align: left; }fixes centred text from the theme; content cut off at the sidebar edge usually comes fromoverflow: hiddenon the widget, so set.widget.WOOF_Widget { overflow: visible; }. - Invisible checkboxes. A theme rule hides inputs or the skin's boxes; try another skin first, then look for the rule in the inspector.
For different styles on mobile or while a search is running, see CSS per device and styling the page while filtering.
Checklist
- Skin, drop-down skin and tooltips chosen on the Design tab before writing CSS.
- CSS in Custom CSS code or the theme, never in the plugin folder; plain rules, no escapes.
- Every rule starts with
.woofor a.woof_sid_class. - Skin none plus
accent-colorfor brand colours; no resizing of sprite skins. - After a
woof_title_tagchange, rules forh4rewritten. - Caches and CSS optimization cleared before judging the result.
For a specific layout that these rules do not cover, post the page link and a description of the target look on the HUSKY support forum; the FAQ on small CSS customizations explains what to include.