Files
notifications-admin/app/assets/stylesheets/components/pill.scss
T

151 lines
3.1 KiB
SCSS
Raw Normal View History

.pill {
display: flex;
2020-09-04 13:32:34 +01:00
&-item__container {
2017-02-14 14:21:36 +00:00
width: 25%;
flex-grow: 1;
text-align: left;
/*
For browsers that dont support flexbox, use float instead.
Float does not create floating of flex item, and do not take it
out-of-flow. So this is ignored by browsers that support flexbox.
See: https://www.w3.org/TR/css-flexbox-1/#flex-containers
*/
2018-11-13 14:01:19 +00:00
float: left;
2020-02-06 16:38:24 +00:00
/*
Setting this as a flex container means the contents (1 item)
will fill the vertical space due to `align-items` defaulting
to `stretch`.
See: https://css-tricks.com/snippets/css/a-guide-to-flexbox/#prop-align-items
*/
display: flex;
2017-02-14 14:21:36 +00:00
}
2020-09-04 13:32:34 +01:00
&-item,
&-item--selected {
2020-02-07 17:42:53 +00:00
display: flex; // float causes display: block in browsers without flexbox
flex-direction: column;
justify-content: center;
2017-01-23 10:34:08 +00:00
float: left;
2017-02-14 14:21:36 +00:00
box-sizing: border-box;
width: 100%;
2020-08-26 14:24:00 +01:00
padding: 10px 0;
}
2020-09-04 13:32:34 +01:00
&-item {
$background: $link-colour;
background: $background;
color: $white;
border: 2px solid $background;
position: relative;
2016-06-08 15:15:59 +01:00
text-decoration: none;
cursor: pointer;
&:link,
&:visited {
color: $white;
}
&:hover {
color: $light-blue-25;
}
&:active,
&:focus {
z-index: 10;
2020-09-14 23:31:13 +01:00
color: $govuk-focus-text-colour;
/* override default focus styles to inset bottom underline */
box-shadow: inset 0 -4px $govuk-focus-text-colour;
border: none;
padding: 12px 2px; /* compensate for lack of border with padding */
}
}
2020-09-04 13:32:34 +01:00
&-item--selected {
background: inherit;
border: 2px solid $black;
outline: 1px solid rgba($white, 0.1);
position: relative;
z-index: 10;
2017-02-14 14:21:36 +00:00
2020-09-04 13:32:34 +01:00
&:link,
&:visited {
color: $govuk-text-colour;
}
&:hover {
color: govuk-tint($govuk-text-colour, 25%);
}
&:active,
2017-02-14 14:21:36 +00:00
&:focus {
z-index: 1000;
2020-09-14 23:31:13 +01:00
color: $govuk-focus-text-colour;
border: solid 2px $black;
padding: 10px 0px; /* reset padding to default */
box-shadow: inset 0 -2px $govuk-focus-text-colour; /* remove bottom border from underline */
2017-02-14 14:21:36 +00:00
}
}
2020-09-04 13:32:34 +01:00
&-item__label {
2020-08-26 14:24:00 +01:00
2020-09-04 13:32:34 +01:00
text-decoration: underline;
2020-08-26 14:24:00 +01:00
// reduce padding until screen is above 420px / zoomed below 300%
padding-left: govuk-spacing(1);
@include govuk-media-query($from: 420px) {
padding-left: govuk-spacing(2);
}
}
2020-09-14 23:31:13 +01:00
&-item,
&-item--selected {
&:focus .pill-item__label {
text-decoration: none;
}
}
2020-09-04 13:32:34 +01:00
&-item--centered {
text-align: center;
2020-08-26 14:24:00 +01:00
padding-left: 0;
}
2016-04-18 11:10:47 +01:00
}
2016-09-20 11:46:56 +01:00
.pill-separate {
&-item {
display: block;
text-align: left;
2020-02-21 13:21:44 +00:00
padding: 10px govuk-spacing(3);
2018-07-19 10:36:15 +01:00
text-align: center;
2016-09-20 11:46:56 +01:00
&:link,
&:visited {
background: $link-colour;
color: $white;
text-decoration: underline;
}
2020-09-14 23:31:13 +01:00
&:hover {
color: $light-blue-25;
}
2017-10-17 16:34:47 +01:00
&:focus,
&:link:focus {
2020-09-14 23:31:13 +01:00
color: $govuk-focus-text-colour;
text-decoration: none;
background: $govuk-focus-colour;
/* override default focus style to inset bottom underline */
box-shadow: inset 0 -4px $govuk-focus-text-colour;
2016-09-20 11:46:56 +01:00
}
}
}