Skip to content

Commit 3dd35e3

Browse files
Update styles for sticky elements on patient session page
1 parent b88b5b4 commit 3dd35e3

2 files changed

Lines changed: 53 additions & 2 deletions

File tree

app/assets/stylesheets/components/_session-banner.scss

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@use "sass:color";
12
@use "../vendor/nhsuk-frontend" as *;
23

34
.app-session-banner {
@@ -31,7 +32,57 @@
3132
color: $nhsuk-reverse-text-colour;
3233
}
3334

35+
.app-secondary-navigation {
36+
margin: 0;
37+
border-bottom: 0 none;
38+
background: nhsuk-shade($nhsuk-brand-colour, 20%);
39+
box-shadow: 0 -1px 0 0 $nhsuk-secondary-border-colour;
40+
}
41+
3442
.app-secondary-navigation__list {
35-
box-shadow: 0 -1px 0 0 $nhsuk-reverse-border-colour;
43+
box-shadow: none;
44+
45+
@include nhsuk-media-query($until: tablet) {
46+
margin-left: #{$nhsuk-gutter-half * -1};
47+
}
48+
}
49+
50+
&[data-app-sticky-init] {
51+
position: sticky;
52+
z-index: 999;
53+
top: 0;
54+
right: 0;
55+
left: 0;
56+
57+
width: 100vw;
58+
margin-right: -50vw;
59+
margin-left: -50vw;
60+
}
61+
62+
&[data-stuck="true"] {
63+
border-bottom-color: nhsuk-colour("grey-3");
64+
box-shadow: 0 $nhsuk-border-width 0
65+
color.scale(nhsuk-colour("grey-3"), $alpha: -50%);
66+
67+
.app-main-wrapper--xs {
68+
padding-top: nhsuk-spacing(2);
69+
padding-bottom: 0;
70+
}
71+
72+
.nhsuk-breadcrumb {
73+
@include nhsuk-visually-hidden;
74+
}
75+
76+
.nhsuk-heading-l {
77+
@include nhsuk-font-size(22);
78+
}
79+
80+
.app-secondary-navigation {
81+
box-shadow: none;
82+
}
83+
84+
.app-secondary-navigation__list {
85+
@include nhsuk-font-size(16);
86+
}
3687
}
3788
}

app/assets/stylesheets/core/objects/_grid.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
&[data-app-sticky-init] {
2323
@include nhsuk-media-query($from: large-desktop) {
24-
top: #{nhsuk-spacing(9) + nhsuk-spacing(3)};
24+
top: #{nhsuk-spacing(9) + nhsuk-spacing(5)};
2525
}
2626
}
2727
}

0 commit comments

Comments
 (0)