Skip to content

Commit 51c6c5e

Browse files
committed
Add compact and offset card style
This will be used in the consent cards matching the designs in the prototype. Jira-Issue: MAV-1474
1 parent 326c0ee commit 51c6c5e

2 files changed

Lines changed: 28 additions & 2 deletions

File tree

app/assets/stylesheets/_card.scss

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
}
5050
}
5151

52+
&--offset {
53+
background-color: rgba($color_nhsuk-grey-5, 0.5);
54+
}
55+
5256
&--data {
5357
display: flex;
5458

@@ -132,3 +136,22 @@
132136
color: $nhsuk-link-active-color;
133137
}
134138
}
139+
140+
.app-card--compact {
141+
@include nhsuk-responsive-margin(3, "bottom");
142+
143+
.app-button-group {
144+
gap: nhsuk-spacing(2);
145+
margin-bottom: nhsuk-spacing(1);
146+
margin-top: nhsuk-spacing(-4);
147+
}
148+
149+
.nhsuk-card__heading {
150+
@include nhsuk-responsive-margin(1, "bottom");
151+
}
152+
153+
.nhsuk-card__content {
154+
@include nhsuk-responsive-padding(4);
155+
@include nhsuk-responsive-padding(3, "bottom");
156+
}
157+
}

app/components/app_card_component.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def initialize(
3434
secondary: false,
3535
data: false,
3636
patient: false,
37+
compact: false,
3738
filters: false,
3839
section: false
3940
)
@@ -44,10 +45,11 @@ def initialize(
4445
@secondary = secondary
4546
@data = data
4647
@patient = patient
48+
@compact = compact
4749
@filters = filters
4850
@section = section
4951

50-
@feature = (colour.present? && !data) || filters
52+
@feature = (colour.present? && !data && !compact) || filters
5153
end
5254

5355
private
@@ -64,6 +66,7 @@ def card_classes
6466
("nhsuk-card--secondary" if @secondary),
6567
("app-card--data" if @data),
6668
("app-card--patient" if @patient),
69+
("app-card--compact" if @compact),
6770
("app-filters" if @filters)
6871
].compact.join(" ")
6972
end
@@ -80,7 +83,7 @@ def content_classes
8083
def heading_size
8184
if @data
8285
"xs"
83-
elsif @feature || @secondary || @patient
86+
elsif @feature || @secondary || @patient || @compact
8487
"s"
8588
else
8689
"m"

0 commit comments

Comments
 (0)