To style a radio button that shows “All” results from your list on page load you’ll need to have a non-cms radio button, this radio button should be in the same group name as the other radios in your form.
Note: this does not use the fs-cmsfilter-active = is-active
option
To give this button an active state and for it to be checked on load:
- Set the style to custom
- Set the attribute
checked = checked
on the radio input
- To clear the filters add the
fs-cmsfilter-element = clear
attribute to the button’s label
- You can now style the Checked state by selecting it from the style panel state dropdown, note that this will only affect the input (the radio circle) you can use this as the background, styling the rest of the button should be done with custom CSS.
Here is a CSS example that changes the filters label color when the filter is active:
<style>
.directory_radio-input.w--redirected-checked ~ .directory_radio-label {
color: #bcfd2e;
}
</style>
This selector will match the radio button with the class directory_radio-input
that is also in a checked state with the class w--redirected-checked
. Then, the adjacent sibling selector (~
) is used to select the label that comes after the radio button and apply the color property.
- Publish and test!