Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UX: Remove hardcoded "x" from tag count, use :before instead #26991

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/assets/javascripts/discourse/app/components/tag-list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
{{/if}}
{{#if tag.totalCount}}
<span class="tag-count">
x
{{tag.totalCount}}
</span>
{{/if}}
</div>
{{/each}}
<div class="clearfix"></div>
<div class="clearfix"></div>
2 changes: 1 addition & 1 deletion app/assets/javascripts/discourse/app/lib/render-tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function defaultRenderTag(tag, params) {
">";

if (params.count) {
val += " <span class='discourse-tag-count'>x" + params.count + "</span>";
val += " <span class='discourse-tag-count'>" + params.count + "</span>";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be using the tag-count class here instead of the discourse-tag-count? 🤔

}

return val;
Expand Down
3 changes: 3 additions & 0 deletions app/assets/stylesheets/common/base/tagging.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
}

.tag-count {
&:before {
content: "x";
}
font-size: var(--font-down-1);
vertical-align: middle;
line-height: var(--line-height-small);
Expand Down
3 changes: 3 additions & 0 deletions app/assets/stylesheets/common/select-kit/tag-chooser.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
align-items: baseline;

.discourse-tag-count {
&:before {
content: "x";
}
margin-left: 5px;
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/views/tags/_tag.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="tag-box">
<a href="<%= Discourse.base_url %>/tag/<%= tag[:id] %>" class="discourse-tag simple"><%= tag[:text] %></a>
<% if tag[:count] && tag[:count] > 0 %>
<span class="tag-count">x <%= tag[:count] %></span>
<span class="tag-count"><%= tag[:count] %></span>
<% end %>
</div>