Thanx Ansgar.
On my site, I don't see $q_item['raw']['categoryids']. I do see one category id in $q_item['raw']['categoryid']
BTW, I have changed qa-base-theme.php now. But that is part of Core and I don't want to make changes here as it'll have issues when I upgrade.
Since I saw qa-category-<categoryid> class being set elsewhere, I thought it would be good to set it here as well.
BTW, here is the change that I've done right now:
+++ qa-theme-base.php 2021-08-17 17:08:37.054631444 +0530
@@ -1668,12 +1668,19 @@
public function q_list_item($q_item)
{
+ // Set colour per category
+ if (isset($q_item['raw']['categoryid'])) {
+ $this->output('<div class="qa-category-' . $q_item['raw']['categoryid'] . '">');
+ }
$this->output('<div class="qa-q-list-item' . rtrim(' ' . @$q_item['classes']) . '" ' . @$q_item['tags'] . '>');
$this->q_item_stats($q_item);
$this->q_item_main($q_item);
$this->q_item_clear();
$this->output('</div> <!-- END qa-q-list-item -->', '');
+ if (isset($q_item['raw']['categoryid'])) {
+ $this->output('</div> <!-- END qa-category-x -->', '');
+ }
}