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