✨ feat(tags): dynamically adjust tag list columns based on tag count (#233)
This commit is contained in:
parent
d257e022ea
commit
9fc45f288d
@ -1,4 +1,4 @@
|
|||||||
.tag-cloud {
|
#tag-cloud {
|
||||||
margin-top: 4vmin;
|
margin-top: 4vmin;
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
@ -8,6 +8,34 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tags-item {
|
.tags-item {
|
||||||
margin-top: 1rem;
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin column-count($count) {
|
||||||
|
-webkit-column-count: $count;
|
||||||
|
-moz-column-count: $count;
|
||||||
|
column-count: $count;
|
||||||
|
}
|
||||||
|
|
||||||
|
.two-columns ul {
|
||||||
|
@include column-count(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.three-columns ul {
|
||||||
|
@include column-count(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1000px) {
|
||||||
|
.three-columns ul {
|
||||||
|
@include column-count(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 600px) {
|
||||||
|
|
||||||
|
.two-columns ul,
|
||||||
|
.three-columns ul {
|
||||||
|
@include column-count(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
|
|
||||||
{{ macros_page_header::page_header(title=title)}}
|
{{ macros_page_header::page_header(title=title)}}
|
||||||
|
|
||||||
<div class="tag-cloud">
|
{% set tag_count = terms | length %}
|
||||||
|
<div id="tag-cloud" class="{% if tag_count > 16 %}three-columns{% elif tag_count > 8 %}two-columns{% endif %}">
|
||||||
<ul class="tags">
|
<ul class="tags">
|
||||||
{%- for term in terms -%}
|
{%- for term in terms -%}
|
||||||
<li class="tags-item">
|
<li class="tags-item">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user