Skip Navigation

[Resolved] Style Taxonomies Checkbox in Cred (toolset forms)

This support ticket is created 6 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by Nashaat 6 years, 6 months ago.

Assisted by: Nigel.

Author
Posts
#909649

I am trying to style the checkboxes of an individual taxonomy field but no sucess.

I have styled the global checkbox in this form but what i want is to change the style only for this taxonomy field with different colors and different style than all. I tried adding classes for this field but it seems it doesnt help...

You can login here to see the form:
Now the fields are white so you wont see them until you hover next to the options.

What is the best way to style it individually?
Would be greet to send me a clear example how this should look like!
Thanks

#909701

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screen Shot 2018-06-07 at 07.30.52.png

It looks like you have already added a style rule with the following selector to change the appearance of all checkboxes in the form:

.cred-form input[type="checkbox"].checkbox

You just need to add a more precise selector to override those general settings.

In my screenshot there is an individual checkbox highlighted which is inside a li with class tax-deal-type-102, so I could target that individual checkbox with a selector such as

.cred-form .tax-deal-type-103 input[type="checkbox"].checkbox

If you want to target a particular taxonomy then you can add a class to the wrapper DIV in your form, so in the example below I add a class of "tax-statuses".

	<div class="form-group tax-statuses">
		<label>Statuses</label>
		[cred_field field='status' display='checkbox' output='bootstrap']
		[cred_field field='status_add_new' taxonomy='status' type='add_new']
	</div>

I can then target each checkbox for that taxonomy with:

.cred-form .tax-statuses input[type="checkbox"].checkbox
#909750

Thank you Nigel. you helped me understand more for now and for the future!

i have used this as your suggestion

  <div class="col-md-12 columns-design deal-taxo">
    <label class="label-style">Deal Type</label>
		[cred_field field='deal-type' display='checkbox' output='bootstrap']
  </div>

CSS

.cred-form .deal-taxo input[type="checkbox"].checkbox {
  outline: solid 3px #dddddd;
}