Skip to content

Commit

Permalink
fix(badges): Changes based on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Anifacted committed Aug 31, 2020
1 parent 236be98 commit d6bdc4d
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 24 deletions.
19 changes: 15 additions & 4 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2757,26 +2757,37 @@ ul {
/***** Community Badges *****/
/* Styles labels used next to the authors of article comments, community posts, and community comments */
.community-badge-titles {
background-color: #04444D;
background-color: #04444d;
border-radius: 4px;
color: #fff;
font-size: 12px;
font-weight: 600;
margin-right: 2px;
padding: 2px 8px;
vertical-align: middle;
white-space: nowrap;
display: inline-block;
margin-left: 10px;
margin-right: 2px;
}

[dir="rtl"] .community-badge-titles {
margin-right: 10px;
margin-left: 2px;
}

.community-badge-container-achievements {
margin-top: 0.4em;
margin-top: 5px;
}

.community-badge-achievements {
display: inline-block;
margin-right: 0.5em;
margin-left: 0px;
margin-right: 5px;
}

[dir="rtl"] .community-badge-achievements {
margin-right: 0px;
margin-left: 0px;
}

.community-badge-achievements img {
Expand Down
19 changes: 15 additions & 4 deletions styles/_community_badge.scss
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
/***** Community Badges *****/
/* Styles labels used next to the authors of article comments, community posts, and community comments */
.community-badge-titles {
background-color: #04444D;
background-color: #04444d;
border-radius: 4px;
color: #fff;
font-size: 12px;
font-weight: $font-weight-semibold;
margin-right: 2px;
padding: 2px 8px;
vertical-align: middle;
white-space: nowrap;
display: inline-block;
margin-left: 10px;
margin-right: 2px;
}

[dir="rtl"] .community-badge-titles {
margin-right: 10px;
margin-left: 2px;
}

.community-badge-container-achievements {
margin-top: 0.4em;
margin-top: 5px;
}

.community-badge-achievements {
display: inline-block;
margin-right: 0.5em;
margin-left: 0px;
margin-right: 5px;
}

[dir="rtl"] .community-badge-achievements {
margin-right: 0px;
margin-left: 0px;
}

.community-badge-achievements img {
Expand Down
6 changes: 3 additions & 3 deletions templates/article_page.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
{{/link}}
{{#each author.badges}}
{{#is category_slug "titles"}}
<span class="community-badge community-badge-{{category_slug}}" title="{{description}}">
<span class="community-badge community-badge-titles" title="{{description}}" aria-label="{{name}}">
{{#if icon_url}}
<img src="{{icon_url}}" alt="" />
{{/if}}
Expand All @@ -235,8 +235,8 @@
{{#each author.badges}}
{{#is category_slug "achievements"}}
{{#if icon_url}}
<div class="community-badge community-badge-{{category_slug}}">
<img src="{{icon_url}}" alt="{{name}}" title="{{name}} | {{description}}" />
<div class="community-badge community-badge-achievements">
<img src="{{icon_url}}" alt="{{name}}" title="{{name}} | {{description}}" aria-label="{{name}}" />
</div>
{{/if}}
{{/is}}
Expand Down
12 changes: 6 additions & 6 deletions templates/community_post_page.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
{{/link}}
{{#each post.author.badges}}
{{#is category_slug "titles"}}
<span class="community-badge community-badge-{{category_slug}}" title="{{description}}">
<span class="community-badge community-badge-titles" title="{{description}}" aria-label="{{name}}">
{{#if icon_url}}
<img src="{{icon_url}}" alt="" />
{{/if}}
Expand All @@ -84,8 +84,8 @@
{{#each post.author.badges}}
{{#is category_slug "achievements"}}
{{#if icon_url}}
<div class="community-badge community-badge-{{category_slug}}">
<img src="{{icon_url}}" alt="{{name}}" title="{{name}} | {{description}}" />
<div class="community-badge community-badge-achievements">
<img src="{{icon_url}}" alt="{{name}}" title="{{name}} | {{description}}" aria-label="{{name}}" />
</div>
{{/if}}
{{/is}}
Expand Down Expand Up @@ -200,7 +200,7 @@
{{/link}}
{{#each author.badges}}
{{#is category_slug "titles"}}
<span class="community-badge community-badge-{{category_slug}}" title="{{description}}">
<span class="community-badge community-badge-titles" title="{{description}}" aria-label="{{name}}">
{{#if icon_url}}
<img src="{{icon_url}}" alt="" />
{{/if}}
Expand All @@ -223,8 +223,8 @@
{{#each author.badges}}
{{#is category_slug "achievements"}}
{{#if icon_url}}
<div class="community-badge community-badge-{{category_slug}}">
<img src="{{icon_url}}" alt="{{name}}" title="{{name}} | {{description}}" />
<div class="community-badge community-badge-achievements">
<img src="{{icon_url}}" alt="{{name}}" title="{{name}} | {{description}}" aria-label="{{name}}" />
</div>
{{/if}}
{{/is}}
Expand Down
14 changes: 7 additions & 7 deletions templates/user_profile_page.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{{/if}}
{{#each user.badges}}
{{#is category_slug "titles"}}
<span class="community-badge community-badge-{{category_slug}}" title="{{description}}">
<span class="community-badge community-badge-titles" title="{{description}}" aria-label="{{name}}">
{{#if icon_url}}
<img src="{{icon_url}}" alt="" />
{{/if}}
Expand All @@ -31,8 +31,8 @@
{{#each user.badges}}
{{#is category_slug "achievements"}}
{{#if icon_url}}
<div class="community-badge community-badge-{{category_slug}}">
<img src="{{icon_url}}" alt="{{name}}" title="{{name}} | {{description}}" />
<div class="community-badge community-badge-achievements">
<img src="{{icon_url}}" alt="{{name}}" title="{{name}} | {{description}}" aria-label="{{name}}" />
</div>
{{/if}}
{{/is}}
Expand Down Expand Up @@ -250,9 +250,9 @@
<span class="profile-section-description">{{t 'badges_description' name=user.name}}</span>
</header>

<div class="profile-badges-items">
<ul class="profile-badges-items">
{{#each user.badges}}
<section role="region" class="profile-badges-item" aria-labelledby="title-{{id}}" aria-describedby="desc-{{id}}">
<li role="region" class="profile-badges-item" aria-labelledby="title-{{id}}" aria-describedby="desc-{{id}}">
<div class="profile-badges-item-image">
{{#if icon_url}}
<img class="badge" src="{{icon_url}}" alt="">
Expand All @@ -274,9 +274,9 @@
{{date assigned_at format='medium'}}
</p>
</div>
</section>
</li>
{{/each}}
</div>
</ul>
{{else}}
<span class="no-activity">{{t 'no_badges'}}</span>
{{/if}}
Expand Down

0 comments on commit d6bdc4d

Please sign in to comment.