@italia/card 1.0.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,235 @@
1
+ it-card {
2
+ figure {
3
+ margin-bottom: 0;
4
+ }
5
+
6
+ img {
7
+ border-top-left-radius: var(--#{$prefix}card-border-radius-inner);
8
+ border-top-right-radius: var(--#{$prefix}card-border-radius-inner);
9
+ }
10
+
11
+ .it-card-title-icon-wrapper {
12
+ margin-left: var(--#{$prefix}icon-spacing);
13
+ }
14
+
15
+ .it-card-category {
16
+ display: inline-block;
17
+ margin-bottom: 0;
18
+ color: var(--#{$prefix}card-category-color);
19
+ font-size: var(--#{$prefix}card-category-font-size);
20
+ font-weight: var(--#{$prefix}card-category-font-weight);
21
+ text-transform: uppercase;
22
+ }
23
+
24
+ .it-card-chips {
25
+ display: flex;
26
+ flex-wrap: wrap;
27
+ padding: 0;
28
+ margin-bottom: 0;
29
+ gap: calc(var(--#{$prefix}card-spacing-y) * 0.5); // use half spacing for gap
30
+ list-style-type: none;
31
+ }
32
+
33
+ .it-card-date {
34
+ color: var(--#{$prefix}card-date-color);
35
+ font-size: var(--#{$prefix}card-date-font-size);
36
+ }
37
+
38
+ .it-card-link {
39
+ color: var(--#{$prefix}card-link-color);
40
+
41
+ &:hover {
42
+ color: color-hover($color-text-secondary);
43
+ }
44
+
45
+ + .it-card-link {
46
+ margin-left: var(--#{$prefix}card-spacing-x);
47
+ }
48
+ }
49
+
50
+ .it-card-description-list {
51
+ display: flex;
52
+ flex-direction: column;
53
+ padding-top: var(--#{$prefix}card-spacing-y);
54
+ padding-bottom: var(--#{$prefix}card-spacing-y);
55
+ border-top: var(--#{$prefix}card-border-separator-width) solid var(--#{$prefix}card-border-color);
56
+ border-bottom: var(--#{$prefix}card-border-separator-width) solid var(--#{$prefix}card-border-color);
57
+ color: var(--#{$prefix}card-description-color);
58
+ font-size: var(--#{$prefix}label-font-size);
59
+ gap: var(--#{$prefix}spacing-s);
60
+ line-height: var(--#{$prefix}label-leading);
61
+
62
+ @include media-breakpoint-down(sm) {
63
+ display: flex;
64
+ flex-direction: column;
65
+ }
66
+
67
+ dt {
68
+ display: inline;
69
+ margin-right: 0.125rem;
70
+ font-weight: bold;
71
+ }
72
+
73
+ dd {
74
+ display: inline-block;
75
+ margin: 0;
76
+ }
77
+ }
78
+
79
+ .it-card-profile-image-icon-wrapper {
80
+ display: flex;
81
+ align-items: center;
82
+ justify-content: center;
83
+ background-color: $color-background-primary-lighter;
84
+ }
85
+
86
+ .list-group {
87
+ border-top: var(--#{$prefix}card-border-separator-width) solid var(--#{$prefix}card-border-color);
88
+ border-bottom: var(--#{$prefix}card-border-separator-width) solid var(--#{$prefix}card-border-color);
89
+ margin-top: var(--#{$prefix}spacing-s);
90
+ margin-bottom: var(--#{$prefix}spacing-s);
91
+
92
+ .list-group-item {
93
+ padding: var(--#{$prefix}spacing-xs) 0;
94
+ }
95
+
96
+ &:first-child {
97
+ border-top-width: 0;
98
+ @include border-top-radius(var(--#{$prefix}card-border-radius-inner));
99
+ }
100
+
101
+ &:last-child {
102
+ border-bottom-width: 0;
103
+ @include border-bottom-radius(var(--#{$prefix}card-border-radius-inner));
104
+ }
105
+ }
106
+ }
107
+
108
+ ul.it-card-list {
109
+ padding: 0;
110
+ margin: 0;
111
+ list-style-type: none;
112
+
113
+ > li.col,
114
+ > li[class*='col-'] {
115
+ display: block;
116
+ border: none;
117
+ margin-top: 0;
118
+ background: transparent;
119
+ transition: none;
120
+ }
121
+ }
122
+
123
+ .it-card-group {
124
+ --#{$prefix}card-group-gap: 24px;
125
+ display: flex;
126
+ flex-wrap: wrap;
127
+ gap: var(--#{$prefix}card-group-gap);
128
+
129
+ > it-card {
130
+ margin: 0;
131
+ }
132
+
133
+ // Progressive enhancement with Container Queries
134
+ @supports (container-type: inline-size) {
135
+ // Only with .it-card-group-container-aware class
136
+ &.it-card-group-container-aware {
137
+ container-type: inline-size;
138
+
139
+ > it-card {
140
+ // Container Queries
141
+ flex: 1 0 100%;
142
+
143
+ // Reset media queries from small and up
144
+ @include media-breakpoint-up(sm) {
145
+ flex: auto;
146
+ }
147
+
148
+ @container (min-width: 500px) {
149
+ flex: 0 0 calc(50% - 0.5 * var(--#{$prefix}card-group-gap));
150
+ }
151
+
152
+ @container (min-width: 800px) {
153
+ flex: 0 0 calc(33.333% - 0.667 * var(--#{$prefix}card-group-gap));
154
+ }
155
+
156
+ @container (min-width: 1100px) {
157
+ flex: 0 0 calc(25% - 0.75 * var(--#{$prefix}card-group-gap));
158
+ }
159
+ }
160
+
161
+ // Override specific columns in container mode
162
+ &.it-card-group-2-cols > it-card {
163
+ @container (min-width: 500px) {
164
+ flex: 0 0 calc(50% - 0.5 * var(--#{$prefix}card-group-gap));
165
+ }
166
+ }
167
+
168
+ &.it-card-group-3-cols > it-card {
169
+ @container (min-width: 800px) {
170
+ flex: 0 0 calc(33.333% - 0.667 * var(--#{$prefix}card-group-gap));
171
+ }
172
+ }
173
+ }
174
+ }
175
+ /* stylelint-disable-next-line no-duplicate-selectors */
176
+ > it-card {
177
+ // Default stacked on mobile
178
+ flex: 0 0 calc(100% - var(--#{$prefix}card-group-gap));
179
+ // margin: calc(0.5 * var(--#{$prefix}card-group-gap));
180
+
181
+ // Responsive breakpoints
182
+ @include media-breakpoint-up(sm) {
183
+ flex: 0 0 calc(50% - 0.5 * var(--#{$prefix}card-group-gap));
184
+ }
185
+
186
+ @include media-breakpoint-up(md) {
187
+ flex: 0 0 calc(33.333% - 0.667 * var(--#{$prefix}card-group-gap));
188
+ }
189
+
190
+ @include media-breakpoint-up(lg) {
191
+ flex: 0 0 calc(25% - 0.75 * var(--#{$prefix}card-group-gap));
192
+ }
193
+ }
194
+
195
+ // Predefined column layouts
196
+ &.it-card-group-2-cols > it-card,
197
+ &.it-card-group-3-cols > it-card,
198
+ &.it-card-group-4-cols > it-card {
199
+ @include media-breakpoint-up(sm) {
200
+ flex: 0 0 calc(50% - 0.5 * var(--#{$prefix}card-group-gap));
201
+ }
202
+ }
203
+
204
+ &.it-card-group-3-cols > it-card {
205
+ @include media-breakpoint-up(md) {
206
+ flex: 0 0 calc(33.333% - 0.667 * var(--#{$prefix}card-group-gap));
207
+ }
208
+ }
209
+
210
+ &.it-card-group-4-cols > it-card {
211
+ @include media-breakpoint-up(md) {
212
+ flex: 0 0 calc(33.333% - 0.667 * var(--#{$prefix}card-group-gap));
213
+ }
214
+
215
+ @include media-breakpoint-up(lg) {
216
+ flex: 0 0 calc(25% - 0.75 * var(--#{$prefix}card-group-gap));
217
+ }
218
+ }
219
+
220
+ // Option for equal height cards
221
+ &.it-card-group-equal-height > it-card {
222
+ height: 100%;
223
+ }
224
+
225
+ // Options for alignments
226
+ &.it-card-group-center {
227
+ justify-content: center;
228
+ }
229
+
230
+ &.it-card-group-end {
231
+ justify-content: flex-end;
232
+ }
233
+ }
234
+
235
+ @import './fouc';