No gap between vote count and tags in header

Similar to No Gap Between Vote Count and Tags in Topic List there is also no gap between votes and the tag(s) in the header when there are 0 votes and at least 1 tag

1 Like

That might be my fault :thinking:

Is it just on meta, or can you see the same thing on another site?

I did not notice it anywhere else and it isn’t a problem in safe mode

I found this and used it:

// hide 0 vote count


.vote-count-0 {
  display: none; 
}

// hide the comma on the second to last tag

.discourse-tags:has(.vote-count-0) { 
  .discourse-tag:nth-last-child(2):after {
     display: none; 
  }
}

It may need a tweak?

2 Likes

I think you can improve the CSS this way, so you don’t need to specify what child (it can be useful if something is displayed after the votes; for example).

.discourse-tags {
    /* hide 0 vote count */
    .vote-count-0,
    
    /* hides the comma from the previous sibling of .vote-count-0 */
    & :has(+ .vote-count-0)::after { 
      display: none !important;
    }
}
1 Like

Let’s give to a try :heart: :slight_smile:

It looks like you might need !important. I noticed it’s overwritten by header.scss. I updated the code above.

2 Likes

note I always recommend important to be last resort, usually I go for making stuff more selective if at all possible.

2 Likes

I went with this:

.topic-list .discourse-tags {
    /* hide 0 vote count */
    .vote-count-0,
    
    /* hides the comma from the previous sibling of .vote-count-0 */
    & :has(+ .vote-count-0)::after { 
      display: none 
    }
}

Keeping the ‘0 votes’ info in-topic felt right, and this tidied up the spacing.


I noticed that I also needed to hide them from inside the feedback topics… After some time I finally landed on this:


.ask-chapoi {

 display: humbleness;
 admit: failure;

}

3 Likes