Browse Source

Fix strange wrapping of colon after topic type

The way I was doing this before had the colon as part of the metadata,
which meant that it could wrap onto the next line in thin windows,
giving a result like:

Article
: 1500 words

This changes it so that it's added with CSS after the content type when
needed, so it won't wrap separately.
merge-requests/85/head
Deimos 5 years ago
parent
commit
1da4d95b2b
  1. 6
      tildes/scss/modules/_topic.scss
  2. 2
      tildes/tildes/templates/macros/topics.jinja2

6
tildes/scss/modules/_topic.scss

@ -90,6 +90,12 @@
margin-right: 0.4rem;
}
// Add a colon after the topic-content-type only when there's metadata after it
.topic-content-type:not(:last-child)::after {
content: ": ";
margin-right: 0.2rem;
}
.topic-group {
margin-right: 0.4rem;
}

2
tildes/tildes/templates/macros/topics.jinja2

@ -49,7 +49,7 @@
<span class="topic-content-type">{{ topic.content_type.display_name if topic.content_type else "Link" }}</span>
{% if topic.content_metadata_for_display %}
<span class="topic-content-metadata">: {{ topic.content_metadata_for_display }}</span>
<span class="topic-content-metadata">{{ topic.content_metadata_for_display }}</span>
{% endif %}
{% if topic.unimportant_tags and request.user and request.user.show_tags_in_listings %}

Loading…
Cancel
Save