1+ @use ' nhsuk-frontend/dist/nhsuk/core/settings' as * ;
2+ @use ' nhsuk-frontend/dist/nhsuk/core/tools' as * ;
3+
4+ // Styles for summary card adapted from:
5+ // https://github.com/alphagov/govuk-frontend/blob/main/packages/govuk-frontend/src/govuk/components/summary-list/_index.scss
6+
7+ .nhsuk-summary-card__action {
8+ display : inline-block ;
9+ }
10+
11+ @include nhsuk-media-query ($until : tablet) {
12+ .nhsuk-summary-card__action {
13+ margin-right : nhsuk-spacing (2 );
14+ padding-right : nhsuk-spacing (2 );
15+ border-right : 1px solid $nhsuk-border-color ;
16+ }
17+
18+ .nhsuk-summary-card__action :last-child {
19+ margin-right : 0 ;
20+ padding-right : 0 ;
21+ border : 0 ;
22+ }
23+ }
24+
25+ @include nhsuk-media-query ($from : tablet) {
26+ .nhsuk-summary-card__action {
27+ margin-left : nhsuk-spacing (2 );
28+ padding-left : nhsuk-spacing (2 );
29+ }
30+
31+ .nhsuk-summary-card__action :not (:first-child ) {
32+ border-left : 1px solid $nhsuk-border-color ;
33+ }
34+
35+ .nhsuk-summary-card__action :first-child {
36+ margin-left : 0 ;
37+ padding-left : 0 ;
38+ border : 0 ;
39+ }
40+ }
41+
42+ // Additional block for the summary card
43+ .nhsuk-summary-card {
44+ border : 1px solid $nhsuk-border-color ;
45+ @include nhsuk-responsive-margin (6 , " bottom" );
46+ }
47+
48+ .nhsuk-summary-card__title-wrapper {
49+ padding : nhsuk-spacing (3 );
50+
51+ // Ensures the card header appears separate to the summary list in forced
52+ // colours mode
53+ border-bottom : 1px solid transparent ;
54+ background-color : $color_nhsuk-grey-5 ;
55+
56+ @include nhsuk-media-query ($from : " tablet" ) {
57+ display : flex ;
58+ // Justify removed because we always want actions on the right
59+ // /justify-content: space-between;
60+ flex-wrap : nowrap ;
61+ padding : nhsuk-spacing (3 ) nhsuk-spacing (4 );
62+ }
63+ }
64+
65+ .nhsuk-summary-card__title {
66+ @include nhsuk-font ($size : 19 , $weight : bold );
67+ color : $nhsuk-text-color ;
68+ margin : nhsuk-spacing (1 ) nhsuk-spacing (4 ) nhsuk-spacing (2 ) 0 ;
69+
70+ @include nhsuk-media-query ($from : " tablet" ) {
71+ margin-bottom : nhsuk-spacing (1 );
72+ }
73+ }
74+
75+ .nhsuk-summary-card__actions {
76+ @include nhsuk-font-size ($size : 19 );
77+ @include nhsuk-typography-weight-bold ;
78+ display : flex ;
79+ flex-wrap : wrap ;
80+ row-gap : 10px ;
81+ margin : nhsuk-spacing (1 ) 0 ;
82+ padding : 0 ;
83+ list-style : none ;
84+
85+ @include nhsuk-media-query ($from : " tablet" ) {
86+ justify-content : right ;
87+ text-align : right ;
88+ margin-left : auto ; // Added so actions are always aligned right
89+ }
90+ }
91+
92+ .nhsuk-summary-card__action {
93+ display : inline ;
94+
95+ // We use the following media query to target IE11 and 10 only to add margin
96+ // between actions.
97+ //
98+ // We do this because we're using row-gap to create space between actions on
99+ // more evergreen browsers which IE doesn't support. @supports currently isn't
100+ // a viable solution, see https://github.com/w3c/csswg-drafts/issues/3559.
101+ //
102+ // Solution taken from https://stackoverflow.com/questions/11173106/apply-style-only-on-ie#answer-36448860
103+ // which also includes an explanation of why this works
104+ @media screen and (-ms-high-contrast : active ), (-ms-high-contrast : none ) {
105+ margin-bottom : nhsuk-spacing (1 );
106+ }
107+ }
108+
109+ .nhsuk-summary-card__action :last-child {
110+ // See above comment for why this is here
111+ @media screen and (-ms-high-contrast : active ), (-ms-high-contrast : none ) {
112+ margin-bottom : 0 ;
113+ }
114+ }
115+
116+ .nhsuk-summary-card__content {
117+ padding : nhsuk-spacing (3 ) nhsuk-spacing (3 ) 0 ;
118+
119+ @include nhsuk-media-query ($from : " tablet" ) {
120+ padding : nhsuk-spacing (3 ) nhsuk-spacing (4 );
121+ }
122+
123+ .nhsuk-summary-list {
124+ margin-bottom : 0 ;
125+ }
126+
127+ .nhsuk-summary-list__row :last-of-type {
128+ margin-bottom : 0 ;
129+ border-bottom : none ;
130+ }
131+ }
132+
133+ .nhsuk-summary-card--no-border {
134+ border : none ;
135+
136+ .nhsuk-summary-card__actions {
137+ @include nhsuk-typography-weight-normal ;
138+ }
139+
140+ .nhsuk-summary-card__action {
141+ margin-bottom : 0 ;
142+ }
143+
144+ .nhsuk-summary-card__title-wrapper {
145+ background-color : inherit ;
146+ }
147+
148+ .nhsuk-summary-card__title-wrapper , .nhsuk-summary-card__content {
149+ padding : 0 ;
150+ }
151+ }
152+
153+ .nhsuk-summary-card--compact {
154+
155+ .nhsuk-summary-card__actions {
156+ @include nhsuk-typography-weight-normal ;
157+ }
158+
159+ .nhsuk-summary-card__action {
160+ margin-bottom : 0 ;
161+ }
162+
163+ .nhsuk-summary-card__title-wrapper , .nhsuk-summary-card__content {
164+ padding : nhsuk-spacing (1 ) nhsuk-spacing (2 );
165+ }
166+ }
0 commit comments