UX: Some category page style adjustments for sub-sub categories

This commit is contained in:
Kris 2019-12-20 16:17:34 -05:00
parent 6ec3d42b16
commit 00477d8f88
4 changed files with 86 additions and 21 deletions

View File

@ -14,17 +14,23 @@
<tr data-category-id={{c.id}} class="{{if c.description_excerpt 'has-description' 'no-description'}} {{if c.uploaded_logo.url 'has-logo' 'no-logo'}}"> <tr data-category-id={{c.id}} class="{{if c.description_excerpt 'has-description' 'no-description'}} {{if c.uploaded_logo.url 'has-logo' 'no-logo'}}">
<td class="category" style={{border-color c.color}}> <td class="category" style={{border-color c.color}}>
{{category-title-link category=c}} {{category-title-link category=c}}
{{#if c.description_excerpt}}
<div class="category-description"> <div class="category-description">
{{{dir-span c.description_excerpt}}} {{{dir-span c.description_excerpt}}}
</div> </div>
{{/if}}
{{#if c.isGrandParent}} {{#if c.isGrandParent}}
<table class="category-list"> <table class="category-list subcategories-with-subcategories">
{{#each c.subcategories as |subcategory|}} {{#each c.subcategories as |subcategory|}}
<tr data-category-id={{subcategory.id}} class="{{if subcategory.description_excerpt 'has-description' 'no-description'}} {{if subcategory.uploaded_logo.url 'has-logo' 'no-logo'}}"> <tr data-category-id={{subcategory.id}} class="{{if subcategory.description_excerpt 'has-description' 'no-description'}} {{if subcategory.uploaded_logo.url 'has-logo' 'no-logo'}}">
<td class="category" style={{border-color subcategory.color}}> <td class="category" style={{border-color subcategory.color}}>
{{category-title-link tagName="h4" category=subcategory}} {{category-title-link tagName="h4" category=subcategory}}
{{log subcategory}}
{{#if subcategory.description_excerpt}}
<div class="category-description subcategory-description">
{{{dir-span subcategory.description_excerpt}}}
</div>
{{/if}}
{{#if subcategory.subcategories}} {{#if subcategory.subcategories}}
<div class='subcategories'> <div class='subcategories'>
{{#each subcategory.subcategories as |subsubcategory|}} {{#each subcategory.subcategories as |subsubcategory|}}
@ -37,10 +43,12 @@
{{/each}} {{/each}}
</div> </div>
{{else}} {{else}}
<div class="category-description"> {{#if subcategory.description_excerpt}}
<div class="category-description subcategory-description">
{{{dir-span subcategory.description_excerpt}}} {{{dir-span subcategory.description_excerpt}}}
</div> </div>
{{/if}} {{/if}}
{{/if}}
</td> </td>
</tr> </tr>
{{/each}} {{/each}}

View File

@ -11,6 +11,13 @@
vertical-align: text-top; vertical-align: text-top;
line-height: $line-height-medium; line-height: $line-height-medium;
} }
&.with-topics {
.subcategories-with-subcategories {
.category-description {
display: none;
}
}
}
} }
.category-boxes, .category-boxes,
@ -195,14 +202,26 @@
} }
.categories-list .category { .categories-list .category {
h3 .d-icon { h3,
color: $primary-medium; h4 {
margin-bottom: 0;
.d-icon {
color: $primary-high;
height: 0.76em; height: 0.76em;
width: 0.76em; width: 0.76em;
vertical-align: baseline; vertical-align: baseline;
margin-right: 0.15em; margin-right: 0.15em;
} }
} }
.category-description {
margin-top: 0.5em;
overflow: hidden;
color: $primary-high;
}
.category-logo.aspect-image {
margin-top: 0.5em;
}
}
.category-boxes-with-topics, .category-boxes-with-topics,
.category-boxes { .category-boxes {
@ -210,3 +229,15 @@
margin-right: 0; margin-right: 0;
} }
} }
.category-list.subcategories-with-subcategories {
margin-top: 1em;
margin-bottom: 0;
border-top: 1px solid $primary-low;
.category-description {
font-size: $font-down-1;
}
.category-logo.aspect-image {
--max-height: 75px;
}
}

View File

@ -151,4 +151,10 @@
.topic-featured-link { .topic-featured-link {
padding-left: 8px; padding-left: 8px;
} }
.subcategories-with-subcategories {
.category-description {
display: none;
}
}
} }

View File

@ -218,7 +218,6 @@
// Category list // Category list
// -------------------------------------------------- // --------------------------------------------------
.categories-list .category-list { .categories-list .category-list {
margin-left: -10px;
margin-bottom: 2em; margin-bottom: 2em;
td { td {
@ -265,10 +264,22 @@
} }
.subcategory-list-item.category { .subcategory-list-item.category {
display: block;
width: calc(100% + 20px);
margin: 1.25em 10px 0;
border-bottom: none !important;
border-top: 1px solid $primary-low !important;
&:last-of-type {
margin-top: 0;
margin-bottom: 1.25em;
border-bottom: 1px solid $primary-low !important;
}
td:first-of-type { td:first-of-type {
padding: 12px 0px; padding: 12px 0px;
} }
.category-logo.aspect-image {
display: none;
}
.subcategories { .subcategories {
padding-left: 10px; padding-left: 10px;
} }
@ -283,9 +294,8 @@ tr.category-topic-link {
.category-list-item, .category-list-item,
.subcategory-list-item { .subcategory-list-item {
padding: 5px 0 2px 3px; padding: 0 0 0 3px;
border-left: 6px solid; border-left: 6px solid;
border-top: 1px solid;
h3, h3,
h4 { h4 {
@ -326,9 +336,12 @@ tr.category-topic-link {
padding-bottom: 15px; padding-bottom: 15px;
} }
.subcategories-list td { .subcategories-list {
border-bottom: none;
td {
padding-top: 15px; padding-top: 15px;
} }
}
.topic-list > tbody > tr { .topic-list > tbody > tr {
&:nth-child(odd) { &:nth-child(odd) {
@ -376,6 +389,13 @@ tr.category-topic-link {
} }
} }
.category-list-item {
padding: 0.5em 0 0.25em;
border-top: 1px solid $primary-low !important;
border-bottom: 1px solid $primary-low !important;
margin-bottom: 2em;
}
.category-box { .category-box {
h3 { h3 {
margin: 0 0 0.5em 0; margin: 0 0 0.5em 0;