Category - Dropdown Style


(Sebastien Miquerolle) #1

Hello,

I have an issue with the color of the dropdown button for category:

  • If I want to keep the color of my category, the default color cannot be override…

  • If I override, it’s not really sexy.

I cannot override the style only for “Home”, “With/Without Sub Category” because they don’t have the home class. Could you add the home class aside the badge-category category-dropdown-button like the previous <a> tag.

<a href="#" data-ember-action="183" class="badge-category home" style="background-color: #eee; color: #333" data-bindattr-184="184">

<a href="#" data-ember-action="185" class="badge-category category-dropdown-button home" style="background-color: #eee; color: #333" data-bindattr-186="186">

I will try to make the change in the “category-drop.js.handlebars”, but if you have some advice/tips to me, it will be really appreciate.

Thanks.


(Kris) #2

Good timing! I just ran into this same problem this morning.

If I override the home category in a theme - I also have to override the dropdown button to match… but if I override the default dropdown style it doesn’t change and match other categories.

I agree with your solution of adding a home class to that dropdown button! Hopefully someone from the team can handle that soon.


(Robin Ward) #3

I think this should work for you guys:

https://github.com/discourse/discourse/commit/33f483a47e2b08a725ef3bbdc60dfb4128c3513d


(Sebastien Miquerolle) #4

Thanks ! I update my forum and try it.

Edit: @eviltrout : Sad, that doesn’t work. I have the home class for all category, not only the “All Category” and “With/Without SubCategory”. If I read the file, maybe it’s something like:

{{#if category}}
<a href='#' {{action expand}} class='badge-category category-dropdown-button' {{bind-attr style="badgeStyle"}}><i {{bind-attr class="iconClass"}}></i></a>
{{else}}
<a href='#' {{action expand}} class='badge-category category-dropdown-button home' {{bind-attr style="badgeStyle"}}><i {{bind-attr class="iconClass"}}></i></a>
{{/if}}

(Robin Ward) #5

I think I understand better. I’ve just committed another change that will only apply home when there is no category selected.


(Sebastien Miquerolle) #6

Just Perfect ! Thanks :thumbsup:


(Jeff Atwood) #7