Skip to content

Commit 8aa4664

Browse files
Align breadcrumb back link with back link
1 parent b12771f commit 8aa4664

File tree

1 file changed

+37
-16
lines changed

1 file changed

+37
-16
lines changed

packages/components/breadcrumb/_index.scss

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
@include nhsuk-font(16); // [4]
4242

4343
&:not(:last-child)::after {
44-
background: url("data:image/svg+xml,%3Csvg class='nhsuk-icon nhsuk-icon__chevron-right' xmlns='http://www.w3.org/2000/svg' fill='%23aeb7bd' height='18' width='18' viewBox='0 0 24 24' aria-hidden='true'%3E%3Cpath d='M15.5 12a1 1 0 0 1-.29.71l-5 5a1 1 0 0 1-1.42-1.42l4.3-4.29-4.3-4.29a1 1 0 0 1 1.42-1.42l5 5a1 1 0 0 1 .29.71z'%3E%3C/path%3E%3C/svg%3E")
44+
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23aeb7bd' height='18' width='18' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 12a1 1 0 0 1-.29.71l-5 5a1 1 0 0 1-1.42-1.42l4.3-4.29-4.3-4.29a1 1 0 0 1 1.42-1.42l5 5a1 1 0 0 1 .29.71z'%3E%3C/path%3E%3C/svg%3E")
4545
right 0 top 0 no-repeat;
4646
content: "";
4747
display: inline-block;
@@ -59,33 +59,54 @@
5959

6060
.nhsuk-breadcrumb__back {
6161
margin: 0;
62-
padding-left: nhsuk-spacing(3);
63-
position: relative;
64-
@include nhsuk-font(16); // [4]
62+
line-height: 1;
6563

6664
@include nhsuk-media-query($from: tablet) {
6765
display: none; // [5]
6866
}
69-
70-
&::before {
71-
background: url("data:image/svg+xml,%3Csvg class='nhsuk-icon nhsuk-icon__chevron-left' xmlns='http://www.w3.org/2000/svg' fill='%23005eb8' height='24' width='24' viewBox='8 0 24 24' aria-hidden='true'%3E%3Cpath d='M8.5 12c0-.3.1-.5.3-.7l5-5c.4-.4 1-.4 1.4 0s.4 1 0 1.4L10.9 12l4.3 4.3c.4.4.4 1 0 1.4s-1 .4-1.4 0l-5-5c-.2-.2-.3-.4-.3-.7z'%3E%3C/path%3E%3C/svg%3E")
72-
no-repeat;
73-
content: "";
74-
display: inline-block;
75-
height: 18px;
76-
left: 0;
77-
position: absolute;
78-
top: -1px;
79-
width: 10px;
80-
}
8167
}
8268

8369
.nhsuk-breadcrumb__backlink {
70+
$icon-background: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23005eb8' height='24' width='24' viewBox='8 0 24 24'%3E%3Cpath d='M8.5 12c0-.3.1-.5.3-.7l5-5c.4-.4 1-.4 1.4 0s.4 1 0 1.4L10.9 12l4.3 4.3c.4.4.4 1 0 1.4s-1 .4-1.4 0l-5-5c-.2-.2-.3-.4-.3-.7z'%3E%3C/path%3E%3C/svg%3E";
71+
$icon-background-hover: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%237c2855' height='24' width='24' viewBox='8 0 24 24'%3E%3Cpath d='M8.5 12c0-.3.1-.5.3-.7l5-5c.4-.4 1-.4 1.4 0s.4 1 0 1.4L10.9 12l4.3 4.3c.4.4.4 1 0 1.4s-1 .4-1.4 0l-5-5c-.2-.2-.3-.4-.3-.7z'%3E%3C/path%3E%3C/svg%3E";
72+
$icon-background-focus: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23212b32' height='24' width='24' viewBox='8 0 24 24'%3E%3Cpath d='M8.5 12c0-.3.1-.5.3-.7l5-5c.4-.4 1-.4 1.4 0s.4 1 0 1.4L10.9 12l4.3 4.3c.4.4.4 1 0 1.4s-1 .4-1.4 0l-5-5c-.2-.2-.3-.4-.3-.7z'%3E%3C/path%3E%3C/svg%3E";
73+
74+
background: none;
75+
border: 0;
76+
cursor: pointer;
77+
display: inline-block;
78+
padding: 0 0 0 16px;
79+
position: relative;
8480
text-decoration: none;
8581

8682
@include nhsuk-link-style-no-visited-state;
83+
@include nhsuk-font(16); // [4]
84+
85+
&::before {
86+
background: url($icon-background) no-repeat 8px 0;
87+
content: "";
88+
display: block;
89+
90+
height: 24px;
91+
left: -8px;
92+
position: absolute;
93+
top: -1px;
94+
width: 24px;
95+
96+
@include nhsuk-media-query($from: tablet) {
97+
top: 0; // [3]
98+
}
99+
}
87100

88101
&:hover {
89102
text-decoration: underline;
90103
}
104+
105+
&:hover::before {
106+
background-image: url($icon-background-hover);
107+
}
108+
109+
&:focus::before {
110+
background-image: url($icon-background-focus);
111+
}
91112
}

0 commit comments

Comments
 (0)