Skip to content

Commit 65ea50d

Browse files
committed
(#4383) prototyping imageless card group
- digital platform ticket Closes #4383
1 parent 8dbfb9e commit 65ea50d

File tree

3 files changed

+341
-94
lines changed

3 files changed

+341
-94
lines changed

packages/ncids-css/packages/nci-card-group/internal/_nci-card-group.scss

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,44 @@
7676
}
7777
}
7878
}
79+
80+
.nci-imageless-card-group {
81+
ul {
82+
@include u-margin-x('auto');
83+
@include u-width('full');
84+
@include u-display('flex');
85+
@include u-flex('wrap');
86+
row-gap: units(3);
87+
@include at-media('tablet-lg') {
88+
row-gap: units(4);
89+
}
90+
padding-inline-start: 0;
91+
margin-block-start: 0;
92+
margin-block-end: 0;
93+
li {
94+
@include u-display('flex');
95+
flex: 0 0 100%;
96+
@include at-media('tablet-lg') {
97+
flex: 1 0;
98+
}
99+
@include u-margin-bottom(0);
100+
@include u-padding-x(2);
101+
&:last-child {
102+
@include u-margin-bottom(0);
103+
}
104+
}
105+
&:has(li:nth-child(3)) {
106+
li {
107+
flex: 0 0 100%;
108+
@include at-media('tablet-lg') {
109+
flex: 0 0 33%;
110+
}
111+
}
112+
li:nth-child(3n + 2) {
113+
@include at-media('tablet-lg') {
114+
flex: 0 0 34%;
115+
}
116+
}
117+
}
118+
}
119+
}

testing/ncids-css-testing/stories/components/nci-card/nci-card.default.stories.jsx

Lines changed: 54 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -20,48 +20,60 @@ export default {
2020

2121
const Template = (args) => Component(args);
2222

23-
export const Default = () => <TestCase css={css} html={Template.bind({})(
24-
{
25-
'title': 'CRCHD Diversity Training',
26-
'description': 'Treatment for severe COVID-19 with interferons decreased the viral load of SARS-CoV-2, a new study found.',
27-
'imageSource' : img_news1_4x3,
28-
'imageSrc' : img_news1_16x9,
29-
'alt': 'CRCHD Diversity Training',
30-
'ariaLabel': 'Card',
31-
'url': 'http://cancer.gov',
32-
},
33-
)} />;
23+
export const Default = () => (
24+
<TestCase
25+
css={css}
26+
html={Template.bind({})({
27+
title: 'CRCHD Diversity Training',
28+
description:
29+
'Treatment for severe COVID-19 with interferons decreased the viral load of SARS-CoV-2, a new study found.',
30+
imageSource: img_news1_4x3,
31+
imageSrc: img_news1_16x9,
32+
alt: 'CRCHD Diversity Training',
33+
ariaLabel: 'Card',
34+
url: 'http://cancer.gov',
35+
})}
36+
/>
37+
);
3438

3539
const TemplateGroup = (args) => ComponentGroup(args);
3640

37-
export const CardGroup = () => <TestCase css={css} html={TemplateGroup.bind({})(
38-
{ 'items': [
39-
{
40-
'title': 'CRCHD Diversity Training',
41-
'description': 'Treatment for severe COVID-19 with interferons decreased the viral load of SARS-CoV-2, a new study found.',
42-
'imageSource' : img_news1_4x3,
43-
'imageSrc' : img_news1_16x9,
44-
'alt': 'CRCHD Diversity Training',
45-
'ariaLabel': 'Card',
46-
'url': 'http://cancer.gov',
47-
},
48-
{
49-
'title': 'Grant Application Development, Submission, Review, & Award',
50-
'description': 'In patients with certain variations in the OAS1 gene, treatment for severe COVID-19 with interferons decreased the viral load of SARS-CoV-2, a new study found.',
51-
'imageSource' : img_news2_4x3,
52-
'imageSrc' : img_news2_16x9,
53-
'alt': 'Grant Application Development, Submission, Review, & Award',
54-
'ariaLabel': 'Card',
55-
'url': 'http://cancer.gov',
56-
},
57-
{
58-
'title': 'Capacitación en diversidad CRCHD',
59-
'description': 'El tratamiento para la COVID-19 grave con interferones disminuyó la carga viral del SARS-CoV-2, según encontró un nuevo estudio.',
60-
'imageSource' : img_news3_4x3,
61-
'imageSrc' : img_news3_16x9,
62-
'alt': 'Capacitación en diversidad CRCHD',
63-
'ariaLabel': 'Card',
64-
'url': 'http://cancer.gov',
65-
},
66-
]},
67-
)} />;
41+
export const CardGroup = () => (
42+
<TestCase
43+
css={css}
44+
html={TemplateGroup.bind({})({
45+
items: [
46+
{
47+
title: 'CRCHD Diversity Training',
48+
description:
49+
'Treatment for severe COVID-19 with interferons decreased the viral load of SARS-CoV-2, a new study found.',
50+
imageSource: img_news1_4x3,
51+
imageSrc: img_news1_16x9,
52+
alt: 'CRCHD Diversity Training',
53+
ariaLabel: 'Card',
54+
url: 'http://cancer.gov',
55+
},
56+
{
57+
title: 'Grant Application Development, Submission, Review, & Award',
58+
description:
59+
'In patients with certain variations in the OAS1 gene, treatment for severe COVID-19 with interferons decreased the viral load of SARS-CoV-2, a new study found.',
60+
imageSource: img_news2_4x3,
61+
imageSrc: img_news2_16x9,
62+
alt: 'Grant Application Development, Submission, Review, & Award',
63+
ariaLabel: 'Card',
64+
url: 'http://cancer.gov',
65+
},
66+
{
67+
title: 'Capacitación en diversidad CRCHD',
68+
description:
69+
'El tratamiento para la COVID-19 grave con interferones disminuyó la carga viral del SARS-CoV-2, según encontró un nuevo estudio.',
70+
imageSource: img_news3_4x3,
71+
imageSrc: img_news3_16x9,
72+
alt: 'Capacitación en diversidad CRCHD',
73+
ariaLabel: 'Card',
74+
url: 'http://cancer.gov',
75+
},
76+
],
77+
})}
78+
/>
79+
);

0 commit comments

Comments
 (0)