Skip to content

styling bootscore category badge #499

Answered by crftwrk
ersingo asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Ersin,

this is a good question. You cannot change this by the function, but you can search for the category name inside the badges with jQuery and change classes of each of them. Make sure that code is inside the jQuery(function ($) { ... }); wrapper in your child's custom.js.

// Category badge colors
$('.badge:contains("News")').closest('.badge').removeClass('bg-primary-subtle text-primary-emphasis').addClass('text-bg-danger');
$('.badge:contains("Sports")').closest('.badge').removeClass('bg-primary-subtle text-primary-emphasis').addClass('text-bg-primary'); // if your primary color is blue

Change classes as you want.

Solved?

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by ersingo
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@crftwrk
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants