Files
notifications-admin/app/assets/stylesheets/components/pill.scss
Chris Hill-Scott 7cdf6c2495 Fix status counter in old IE versions
We use flexbox to lay out the counts of sending/delivered/failed on the
activity and job pages. flexbox makes the best use of the space when
the numbers can be significantly different widths (eg 0 sending, 5000
delivered).

Flexbox was only supported from IE 11 onwards [1]. And since we were
setting the `display` property of the individual numbers to `block` they
were rendering one-per-line on browsers that don’t support flexbox.

This commit changes these items to be floated and a predefined width. In
browsers that support it, flexbox seems to override these hard-coded
widths. It’s not quite as good as the flexbox solution because:

- it doesn’t adjust the widths in the nice way that flexbox does

- it’s hard-coded to expect 4 items (we don’t have this component with
  any other number of items at the moment, so it won’t actually break
  anything)

But it’s pretty much OK because:

- it’s a lot better than the before

- IE 8 and 9 combined only make up 5% of our users, and this will be a
  declining number

- polyfilling flexbox would mean using Javascript, and we don’t serve
  working Javacript to IE 8 users anyway

1. http://caniuse.com/#feat=flexbox
2017-01-23 10:57:14 +00:00

84 lines
1.1 KiB
SCSS

.pill {
display: flex;
a,
span {
display: block;
width: 25%;
box-sizing: border-box;
float: left;
padding: 10px;
flex-grow: 1;
text-align: left;
&:first-child {
margin-left: 0;
}
&:last-child {
margin-right: 0;
}
}
a {
$background: $link-colour;
background: $background;
color: $white;
border: 2px solid $background;
position: relative;
text-decoration: none;
cursor: pointer;
.pill-label {
text-decoration: underline;
}
&:link,
&:visited {
color: $white;
}
&:hover {
color: $light-blue-25;
}
&:active,
&:focus {
z-index: 10;
}
}
span {
border: 2px solid $black;
outline: 1px solid rgba($white, 0.1);
position: relative;
z-index: 1000;
color: $text-colour;
}
}
.pill-separate {
&-item {
display: block;
text-align: left;
padding: 10px $gutter-half;
&:link,
&:visited {
background: $link-colour;
color: $white;
text-decoration: underline;
}
&:hover {
color: $light-blue-25;
}
}
}