Give headline numbers a blue, not black background

These numbers don’t look very clickable white-on-black.

Blue is the colour of links, so lets see if they are more clickable in
blue.

The same clicking-a-big-number thing is also happening on the activity
page, so this commit also changes the activity page to look the same.
This commit is contained in:
Chris Hill-Scott
2016-06-08 15:41:02 +01:00
parent e7e0b2f227
commit a0f6956eab
6 changed files with 66 additions and 43 deletions

View File

@@ -21,7 +21,7 @@
@extend %big-number; @extend %big-number;
.big-number-number { .big-number-number {
@include bold-36($tabular-numbers: true); @include bold-36();
} }
} }
@@ -39,31 +39,13 @@
.big-number-with-status { .big-number-with-status {
@extend %big-number; @extend %big-number;
background: $text-colour;
color: $white;
position: relative; position: relative;
margin-bottom: $gutter-half; margin-bottom: $gutter-half;
.big-number { .big-number {
padding: 15px; padding: $gutter-half;
position: relative; position: relative;
cursor: pointer;
}
.big-number-overlay-link {
background: transparent;
position: absolute;
top: 0;
left: 0;
background: transparent;
width: 100%;
height: 100%;
&:hover {
background: rgba($text-colour, 0.2);
}
} }
.big-number-label { .big-number-label {
@@ -72,9 +54,31 @@
&:link, &:link,
&:visited { &:visited {
color: $white; color: $link-colour;
text-decoration: none; }
border-bottom: 1px solid $white;
}
.big-number-link {
text-decoration: none;
background: $link-colour;
color: $white;
display: block;
border: 2px solid $link-colour;
margin-bottom: 5px;
&:hover {
color: $light-blue-25;
}
&:active,
&:focus {
outline: 3px solid $yellow;
}
.big-number-label {
text-decoration: underline;
} }
} }
@@ -85,6 +89,7 @@
@include core-19; @include core-19;
display: block; display: block;
background: $green; background: $green;
color: $white;
padding: 15px; padding: 15px;
a { a {
@@ -94,8 +99,13 @@
&:active, &:active,
&:hover { &:hover {
color: $white; color: $white;
text-decoration: none; text-decoration: underline;
border-bottom: 1px solid $white; }
&:active,
&:focus {
color: $black;
border-bottom: 1px solid $black;
} }
} }

View File

@@ -20,9 +20,10 @@
} }
a { a {
background: $panel-colour; $background: $link-colour;
color: $link-colour; background: $background;
border: 1px solid $panel-colour; color: $white;
border: 2px solid $background;
position: relative; position: relative;
text-decoration: none; text-decoration: none;
cursor: pointer; cursor: pointer;
@@ -31,8 +32,13 @@
text-decoration: underline; text-decoration: underline;
} }
&:link,
&:visited {
color: $white;
}
&:hover { &:hover {
color: $text-colour; color: $light-blue-25;
} }
&:active, &:active,
@@ -42,7 +48,10 @@
} }
span { span {
border: 1px solid $grey-1; border: 2px solid $black;
outline: 1px solid rgba($white, 0.1);
position: relative;
z-index: 1000;
color: $text-colour; color: $text-colour;
} }
} }

View File

@@ -2,7 +2,7 @@
table { table {
th { th {
@include core-16; @include core-19;
border-bottom: 0; border-bottom: 0;
} }

View File

@@ -1,4 +1,7 @@
{% macro big_number(number, label, label_link=None, currency='', smaller=False, smallest=False) %} {% macro big_number(number, label, link=None, currency='', smaller=False, smallest=False) %}
{% if link %}
<a class="big-number-link" href="{{ link }}">
{% endif %}
<div class="big-number{% if smaller %}-smaller{% endif %}{% if smallest %}-smallest{% endif %}"> <div class="big-number{% if smaller %}-smaller{% endif %}{% if smallest %}-smallest{% endif %}">
<div class="big-number-number"> <div class="big-number-number">
{% if number is number %} {% if number is number %}
@@ -11,13 +14,13 @@
{{ number }} {{ number }}
{% endif %} {% endif %}
</div> </div>
{% if label_link %} {% if label %}
<a class="big-number-label" href="{{ label_link }}">{{ label }}</a>
<a class="big-number-overlay-link" href="{{ label_link }}" aria-hidden="true"></a>
{% elif label %}
<span class="big-number-label">{{ label }}</span> <span class="big-number-label">{{ label }}</span>
{% endif %} {% endif %}
</div> </div>
{% if link %}
</a>
{% endif %}
{% endmacro %} {% endmacro %}
@@ -28,12 +31,12 @@
failure_percentage, failure_percentage,
danger_zone=False, danger_zone=False,
failure_link=None, failure_link=None,
label_link=None, link=None,
show_more_link=None, show_more_link=None,
show_more_text='' show_more_text=''
) %} ) %}
<div class="big-number-with-status"> <div class="big-number-with-status">
{{ big_number(number, label, label_link) }} {{ big_number(number, label, link=link) }}
<div class="big-number-status{% if danger_zone %}-failing{% endif %}"> <div class="big-number-status{% if danger_zone %}-failing{% endif %}">
{% if failures %} {% if failures %}
{% if failure_link %} {% if failure_link %}

View File

@@ -1,3 +1,4 @@
{% from "components/big-number.html" import big_number %}
{% from "components/message-count-label.html" import message_count_label %} {% from "components/message-count-label.html" import message_count_label %}
{% from "components/big-number.html" import big_number %} {% from "components/big-number.html" import big_number %}

View File

@@ -14,23 +14,23 @@
<div class="column-half"> <div class="column-half">
{{ big_number_with_status( {{ big_number_with_status(
statistics.emails_requested, statistics.emails_requested,
message_count_label(statistics.emails_requested, 'email'), message_count_label(statistics.emails_requested, 'email', suffix=''),
statistics.emails_failed, statistics.emails_failed,
statistics.get('emails_failure_rate', 0.0), statistics.get('emails_failure_rate', 0.0),
statistics.get('emails_failure_rate', 0)|float > 3, statistics.get('emails_failure_rate', 0)|float > 3,
failure_link=url_for(".view_notifications", service_id=current_service.id, message_type='email', status='failed'), failure_link=url_for(".view_notifications", service_id=current_service.id, message_type='email', status='failed'),
label_link=url_for(".view_notifications", service_id=current_service.id, message_type='email', status='sending,delivered,failed') link=url_for(".view_notifications", service_id=current_service.id, message_type='email', status='sending,delivered,failed')
) }} ) }}
</div> </div>
<div class="column-half"> <div class="column-half">
{{ big_number_with_status( {{ big_number_with_status(
statistics.sms_requested, statistics.sms_requested,
message_count_label(statistics.sms_requested, 'sms'), message_count_label(statistics.sms_requested, 'sms', suffix=''),
statistics.sms_failed, statistics.sms_failed,
statistics.get('sms_failure_rate', 0.0), statistics.get('sms_failure_rate', 0.0),
statistics.get('sms_failure_rate', 0)|float > 3, statistics.get('sms_failure_rate', 0)|float > 3,
failure_link=url_for(".view_notifications", service_id=current_service.id, message_type='sms', status='failed'), failure_link=url_for(".view_notifications", service_id=current_service.id, message_type='sms', status='failed'),
label_link=url_for(".view_notifications", service_id=current_service.id, message_type='sms', status='sending,delivered,failed') link=url_for(".view_notifications", service_id=current_service.id, message_type='sms', status='sending,delivered,failed')
) }} ) }}
</div> </div>
<div class="column-whole"> <div class="column-whole">