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

236 lines
4.4 KiB
SCSS
Raw Normal View History

2015-12-17 10:28:15 +00:00
.navigation {
2015-12-14 16:37:15 +00:00
2019-12-11 20:33:57 +00:00
@include govuk-font($size: 19);
2020-02-21 13:21:44 +00:00
padding: 0 govuk-spacing(6) 0 0;
2015-12-14 16:37:15 +00:00
2019-06-21 14:29:52 +01:00
$padding-top: 14px;
$padding-bottom: 11px;
2019-12-11 20:33:57 +00:00
&-service-name,
&-organisation-link {
display: inline-block;
overflow: hidden;
// aligning to the baseline with overflow: hidden adds to the parent's height
// aligning to the top doesn't
// see: https://stackoverflow.com/questions/23529369/why-does-x-overflowhidden-cause-extra-space-below#answer-51088033
vertical-align: top;
white-space: nowrap;
text-overflow: ellipsis;
}
&-service-type {
@include bold-16;
position: relative;
display: inline-block;
margin-left: govuk-spacing(2);
padding: 0 govuk-spacing(1);
text-transform: uppercase;
letter-spacing: 0.05em;
&--training {
background: $grey-3;
color: mix($grey-1, $text-colour);
box-shadow: 0 -3px 0 0 $grey-3;
}
2021-04-19 17:46:42 +01:00
&--suspended {
background: $grey-3;
color: mix($grey-1, $text-colour);
box-shadow: 0 -3px 0 0 $grey-3;
}
2021-06-11 12:03:38 +01:00
&--live, &--test, &--operator {
// This uses new Design System colours to match .govuk-tag--red
background: #F6D7D2;
color: #942514;
box-shadow: 0 -3px 0 0 #F6D7D2;
}
&--government {
background: #942514;
color: #F6D7D2;
box-shadow: 0 -3px 0 0 #942514;
}
}
2019-12-11 20:33:57 +00:00
&-service-switch,
&-service-back-to,
&-organisation-link {
&:link,
&:visited {
text-decoration: none;
}
&:hover {
text-decoration: underline;
}
}
2016-11-18 11:18:29 +00:00
&-service {
2019-12-11 20:33:57 +00:00
@include govuk-font($size: 19);
2016-11-18 11:18:29 +00:00
border-bottom: 1px solid $border-colour;
margin: 0 0 10px;
position: relative;
2017-02-13 10:46:56 +00:00
&-name {
2019-12-11 20:33:57 +00:00
2019-06-21 14:29:52 +01:00
padding: $padding-top 0 $padding-bottom 0;
2019-06-21 15:30:09 +01:00
max-width: 50%;
2019-12-11 20:33:57 +00:00
2016-11-18 11:18:29 +00:00
}
&-switch {
2016-11-18 11:18:29 +00:00
text-align: right;
position: absolute;
top: 0;
right: 0;
2020-02-21 13:21:44 +00:00
padding: $padding-top 0 $padding-bottom govuk-spacing(3);
&:focus {
2020-09-14 22:54:09 +01:00
padding: $padding-top 0px $padding-bottom + 1px govuk-spacing(3) + 10;
/* override default focus style to inset bottom underline */
box-shadow: inset 0 -4px $govuk-focus-text-colour;
}
2016-11-18 11:18:29 +00:00
}
2019-06-21 14:29:52 +01:00
&-back-to {
2020-02-21 13:21:44 +00:00
padding: $padding-top govuk-spacing(3) $padding-bottom 0;
2019-06-21 14:29:52 +01:00
display: inline-block;
}
2016-11-18 11:18:29 +00:00
}
2019-06-21 14:05:00 +01:00
&-organisation-link {
2019-06-21 14:29:52 +01:00
2019-06-21 14:05:00 +01:00
max-width: 25%;
2019-06-21 14:29:52 +01:00
padding: $padding-top 20px $padding-bottom 0;
margin-right: 5px;
2019-06-21 14:12:19 +01:00
box-sizing: border-box;
2019-06-24 15:49:02 +01:00
position: relative;
&:before {
content: "";
display: block;
position: absolute;
top: -1px;
bottom: 1px;
2020-09-14 22:54:09 +01:00
right: 2px;
2019-06-24 15:49:02 +01:00
width: 7px;
height: 7px;
margin: auto 0;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
border: solid;
border-width: 1px 1px 0 0;
border-color: $secondary-text-colour;
}
2019-06-21 14:29:52 +01:00
2020-09-14 22:54:09 +01:00
&:focus:before {
border-color: $govuk-focus-text-colour;
}
2019-12-11 20:33:57 +00:00
// hack to make the focus style fit in the navigation bar
2019-06-21 14:29:52 +01:00
&:focus {
2020-09-14 22:54:09 +01:00
box-shadow: inset 0 -3px $govuk-focus-text-colour, 0 1px $govuk-focus-text-colour;
2019-06-21 14:29:52 +01:00
}
2019-06-21 14:05:00 +01:00
}
li {
2017-08-07 11:43:43 +01:00
margin: 0;
2015-12-17 10:28:15 +00:00
list-style-type: none;
}
2016-02-08 11:11:55 +00:00
a {
2017-08-07 11:43:43 +01:00
display: block;
padding: 5px 0;
position: relative;
top: 5px;
2016-02-08 11:11:55 +00:00
&:link,
&:visited {
text-decoration: none;
}
&:hover {
text-decoration: underline;
}
2015-12-17 10:28:15 +00:00
2018-04-24 12:48:05 +01:00
&.selected {
@include bold-19;
position: relative;
// These two lines stop the width of the item jumping so much
// between selected and unselected states
left: -0.5px;
letter-spacing: -0.01em;
}
2015-12-17 10:28:15 +00:00
}
}
2017-11-28 11:53:24 +00:00
// https://github.com/alphagov/product-page-example/blob/master/source/stylesheets/modules/_sub-navigation.scss
2017-11-28 11:53:24 +00:00
.sub-navigation {
@include media(tablet) {
2020-02-21 13:21:44 +00:00
margin-top: govuk-spacing(6) * 1.5;
2017-11-28 11:53:24 +00:00
}
ol,
ul {
list-style: none;
padding: 0;
margin: 0;
2020-11-17 21:39:34 +00:00
ol,
ul {
margin-top: govuk-spacing(2);
border-top: 1px $grey-3 solid;
}
2017-11-28 11:53:24 +00:00
}
&__item {
@include core-16;
border-bottom: 1px $grey-3 solid;
display: block;
2020-02-21 13:21:44 +00:00
padding: govuk-spacing(2) 0;
2017-11-28 11:53:24 +00:00
a:link {
text-decoration: none;
}
a:hover,
a:active {
text-decoration: underline;
}
2019-04-16 15:19:28 +01:00
ol ol & {
2020-02-21 13:21:44 +00:00
padding-left: govuk-spacing(6);
2020-11-17 21:39:34 +00:00
&:last-of-type {
border-bottom: none;
padding-bottom: 0;
}
2019-04-16 15:19:28 +01:00
}
2017-11-28 11:53:24 +00:00
}
&__item--active {
@include bold-16;
2018-04-24 12:48:05 +01:00
2017-11-28 11:53:24 +00:00
a:link, a:visited {
color: $text-colour;
}
}
}