1+ // Adapted from https://github.com/alphagov/govuk-frontend/blob/main/packages/govuk-frontend/src/govuk/components/notification-banner/_index.scss
2+
3+ $nhsuk-success-color : $color_nhsuk-green !default ;
4+
5+ /// Success link styles
6+ ///
7+ /// Makes links use the success colour. The link will darken if it's active or a
8+ /// user hovers their cursor over it.
9+ ///
10+ /// If you use this mixin in a component, you must also include the
11+ /// `govuk-link-common` mixin to get the correct focus and hover states.
12+ ///
13+ /// @example scss
14+ /// .govuk-component__link {
15+ /// @include govuk-link-common;
16+ /// @include govuk-link-style-success;
17+ /// }
18+ ///
19+ /// @access public
20+
21+ @mixin nhsuk-link-style-success {
22+ & :link ,
23+ & :visited {
24+ color : $nhsuk-success-color ;
25+ }
26+
27+ & :hover {
28+ color : scale-color ($nhsuk-success-color , $lightness : -30% );
29+ }
30+
31+ & :active {
32+ color : $nhsuk-success-color ;
33+ }
34+
35+ // When focussed, the text colour needs to be darker to ensure that colour
36+ // contrast is still acceptable
37+ & :focus {
38+ color : $nhsuk-focus-text-color ;
39+ }
40+ }
41+
42+ .app-notification-banner {
43+ @include nhsuk-font ($size : 19 );
44+ @include nhsuk-responsive-margin (8 , " bottom" );
45+
46+ border : $nhsuk-border-width solid $color_nhsuk-blue ;
47+
48+ background-color : $color_nhsuk-blue ;
49+
50+ & :focus {
51+ outline : $nhsuk-focus-width solid $nhsuk-focus-color ;
52+ }
53+ }
54+
55+ .app-notification-banner__header {
56+ padding : 2px nhsuk-spacing (3 ) nhsuk-spacing (1 );
57+
58+ // Ensures the notification header appears separate to the notification body
59+ // text in high contrast mode
60+ border-bottom : 1px solid transparent ;
61+
62+ @include govuk-media-query ($from : tablet) {
63+ padding : 2px nhsuk-spacing (4 ) nhsuk-spacing (1 );
64+ }
65+ }
66+
67+ .app-notification-banner__title {
68+ // Set the size again because this element is a heading and the user agent
69+ // font size overrides the inherited font size
70+ @include nhsuk-font ($size : 19 );
71+ @include nhsuk-typography-weight-bold ;
72+ margin : 0 ;
73+ padding : 0 ;
74+ color : $color_nhsuk-white ;
75+ }
76+
77+ .app-notification-banner__content {
78+ $padding-tablet : nhsuk-spacing (4 );
79+ color : $nhsuk-text-color ;
80+ padding : nhsuk-spacing (3 );
81+
82+ background-color : $color_nhsuk-white ;
83+
84+ @include govuk-media-query ($from : tablet) {
85+ padding : $padding-tablet ;
86+ }
87+
88+ // Wrap content at the same place that a 2/3 grid column ends, to maintain
89+ // shorter line-lengths when the notification banner is full width
90+ > * {
91+ // When elements have their own padding (like lists), include the padding
92+ // in the max-width calculation
93+ box-sizing : border-box ;
94+
95+ // Calculate the internal width of a two-thirds column...
96+ $two-col-width : ($nhsuk-page-width * 2 / 3 ) - ($nhsuk-gutter * 1 / 3 );
97+
98+ // ...and then factor in the left border and padding
99+ $banner-exterior : ($padding-tablet + $nhsuk-border-width );
100+ max-width : $two-col-width - $banner-exterior ;
101+ }
102+
103+ > :last-child {
104+ margin-bottom : 0 ;
105+ }
106+ }
107+
108+ .app-notification-banner__heading {
109+ @include nhsuk-font ($size : 24 );
110+ @include nhsuk-typography-weight-bold ;
111+
112+ margin : 0 0 nhsuk-spacing (3 );
113+
114+ padding : 0 ;
115+ }
116+
117+ .app-notification-banner__link {
118+ @include nhsuk-link-style-default ;
119+ @include nhsuk-link-style-no-visited-state ;
120+ }
121+
122+ .app-notification-banner--success {
123+ border-color : $nhsuk-success-color ;
124+ background-color : $nhsuk-success-color ;
125+
126+ .app-notification-banner__link {
127+ @include nhsuk-link-style-success ;
128+ }
129+ }
0 commit comments