Commit be2eb519 authored by Kyle Keating's avatar Kyle Keating

Improve `aria-label` on annotation tags

Improve contrast on tags
Fix a bug where the link hover color was not working in some cases
parent b3000cbe
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
ng-if="(vm.canCollapseBody || vm.state().tags.length) && !vm.editing()"> ng-if="(vm.canCollapseBody || vm.state().tags.length) && !vm.editing()">
<ul class="tag-list" aria-label="Annotation tags"> <ul class="tag-list" aria-label="Annotation tags">
<li class="tag-item" ng-repeat="tag in vm.state().tags"> <li class="tag-item" ng-repeat="tag in vm.state().tags">
<a ng-href="{{vm.tagSearchURL(tag)}}" target="_blank">{{tag}}</a> <a ng-href="{{vm.tagSearchURL(tag)}}" aria-label="Tag: {{tag}}" target="_blank">{{tag}}</a>
</li> </li>
</ul> </ul>
<div class="u-stretch"></div> <div class="u-stretch"></div>
......
...@@ -102,13 +102,3 @@ ...@@ -102,13 +102,3 @@
background-color: $color-mine-shaft; background-color: $color-mine-shaft;
} }
} }
// Tint and shade functions from
// https://css-tricks.com/snippets/sass/tint-shade-functions
@function tint($color, $percent) {
@return mix(white, $color, $percent);
}
@function shade($color, $percent) {
@return mix(black, $color, $percent);
}
...@@ -10,8 +10,9 @@ tags-input { ...@@ -10,8 +10,9 @@ tags-input {
} }
.tags { .tags {
display: flex;
flex-wrap: wrap;
@include form-input; @include form-input;
@include pie-clearfix;
&.focused { &.focused {
@include form-input-focus; @include form-input-focus;
...@@ -19,7 +20,6 @@ tags-input { ...@@ -19,7 +20,6 @@ tags-input {
// Input // Input
.input { .input {
float: left;
padding: 0.1333em 0; padding: 0.1333em 0;
outline: none; outline: none;
border: none !important; border: none !important;
...@@ -35,18 +35,19 @@ tags-input { ...@@ -35,18 +35,19 @@ tags-input {
.tag-list { .tag-list {
margin-top: -0.33em; // Absorb the first row of margin-top on the tags. margin-top: -0.33em; // Absorb the first row of margin-top on the tags.
float: left; display: flex;
flex-wrap: wrap;
} }
.tag-item { .tag-item {
float: left;
position: relative; position: relative;
padding: 0.0769em 1.307em 0.0769em 0.538em; padding: 0.0769em 1.307em 0.0769em 0.538em;
margin-top: 0.384em; margin-top: 0.384em;
margin-right: 0.384em; margin-right: 0.384em;
font-size: 0.866em; font-size: 0.866em;
color: $button-text-color; color: $grey-6;
border: 1px solid $gray-lighter; border: 1px solid $grey-4;
background-color: $grey-3;
border-radius: 2px; border-radius: 2px;
&.selected { &.selected {
...@@ -73,11 +74,12 @@ tags-input { ...@@ -73,11 +74,12 @@ tags-input {
} }
.tags-read-only { .tags-read-only {
font-size: 0.8461em; font-size: $normal-font-size;
margin: 0.4545em 0; margin: 0.4545em 0;
.tag-list { .tag-list {
@include pie-clearfix; display: flex;
flex-wrap: wrap;
// Margin between bottom of ascent of annotation body and // Margin between bottom of ascent of annotation body and
// top of tags list should be ~15px // top of tags list should be ~15px
margin-top: -$layout-h-margin + 10px; margin-top: -$layout-h-margin + 10px;
...@@ -86,16 +88,15 @@ tags-input { ...@@ -86,16 +88,15 @@ tags-input {
margin-bottom: $layout-h-margin - 10px; margin-bottom: $layout-h-margin - 10px;
.tag-item { .tag-item {
float: left; margin: 0 0.4545em 0.4545em 0;
margin-right: 0.4545em;
a { a {
text-decoration: none; text-decoration: none;
border: 1px solid $gray-lighter; border: 1px solid $grey-3;
border-radius: 2px; border-radius: 2px;
padding: 0 0.4545em 0.1818em; padding: 0 0.4545em 0.1818em;
color: $gray-light; color: $grey-6;
background: $gray-lightest; background: $grey-2;
&:hover, &:hover,
&:focus { &:focus {
......
...@@ -46,6 +46,16 @@ $grey-7: #202020; ...@@ -46,6 +46,16 @@ $grey-7: #202020;
$brand: #bd1c2b; $brand: #bd1c2b;
$highlight: #58cef4; $highlight: #58cef4;
// Tint and shade functions from
// https://css-tricks.com/snippets/sass/tint-shade-functions
@function tint($color, $percent) {
@return mix(white, $color, $percent);
}
@function shade($color, $percent) {
@return mix(black, $color, $percent);
}
@function color-weight($c, $n: 500) { @function color-weight($c, $n: 500) {
@if $n == 50 { @if $n == 50 {
@return tint($c, 85%); @return tint($c, 85%);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment