@ilo-org/styles 0.10.1 → 0.10.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ilo-org/styles",
3
3
  "description": "Styles for products using ILO's Design System",
4
- "version": "0.10.1",
4
+ "version": "0.10.2",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/international-labour-organization/designsystem.git",
@@ -20,7 +20,7 @@
20
20
  "dependencies": {
21
21
  "@ilo-org/fonts": "0.1.0",
22
22
  "@ilo-org/icons": "0.2.1",
23
- "@ilo-org/themes": "0.5.1"
23
+ "@ilo-org/themes": "0.6.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "cssnano": "^5.1.13",
@@ -2,29 +2,28 @@
2
2
  @use "../functions" as *;
3
3
  @import "../mixins";
4
4
 
5
- // @TODO: The grid layout is fairly clean until you get to the placement of the caption which breaks out of it
6
- // and uses a lot of absolute positioning. This should be cleaned up to use the grid layout more effectively.
7
-
8
5
  .hero {
9
6
  $c: &;
10
7
 
11
- // SASS vars are all constants
12
- $tooltip-width: 30px;
13
- $tooltip-height: 27px;
14
- $image-max-height: 216px;
15
- $corner-cut-sm: 39px;
16
- $corner-cut-lg: 64px;
8
+ // Offset from the edge of the window to keep content in the main content area
9
+ $base-offset: calc((100vw - #{$layout-max-width}) / 2);
10
+
11
+ // Card offset from the edge of the window minus the card's padding
12
+ $card-offset: calc(#{$base-offset} - #{$spacing-hero-card-padding-x-lg});
13
+
14
+ // Added offset for justified offset
15
+ $card-offset-justified: minmax(108px, #{$card-offset});
17
16
 
18
- // CSS vars can be changed
19
- --corner-cut-height: #{$corner-cut-sm};
17
+ // The height of the corner cut
18
+ --corner-cut-height: #{$spacing-hero-card-corner-cut-height-sm};
20
19
 
21
20
  width: 100%;
22
21
  display: grid;
23
22
  position: relative;
24
23
  grid-template-rows:
25
- minmax($image-max-height, 1fr)
26
- $tooltip-height
27
- $corner-cut-sm
24
+ minmax($spacing-hero-image-max-height, 1fr)
25
+ $spacing-hero-tooltip-height
26
+ $spacing-hero-card-corner-cut-height-sm
28
27
  auto;
29
28
  grid-template-columns: 1fr;
30
29
 
@@ -53,27 +52,30 @@
53
52
  grid-area: 2 / 1 / 3 / 2;
54
53
 
55
54
  &--wrapper {
56
- @include caption-icon-wrapper("right", $tooltip-width, $tooltip-height);
55
+ @include caption-icon-wrapper(
56
+ "right",
57
+ $spacing-hero-tooltip-width,
58
+ $spacing-hero-tooltip-height
59
+ );
57
60
  }
58
61
  }
59
62
 
60
63
  @include breakpoint("large") {
61
- --card-width: minmax(200px, 625px);
62
- --corner-cut-height: #{$corner-cut-lg};
64
+ --card-width: 625px;
65
+ --corner-cut-height: #{$spacing-hero-card-corner-cut-height-lg};
63
66
  --breadcrumbs-height: 48px;
64
- --card-offset: 109px;
65
67
  --image-gap: 240px;
66
68
 
67
69
  // Defaults to baseline
68
70
  --row-1-lg: var(--breadcrumbs-height);
69
71
  --row-2-lg: calc(var(--image-gap) - var(--breadcrumbs-height));
70
72
  --row-3-lg: auto;
71
- --row-4-lg: #{$tooltip-height};
73
+ --row-4-lg: #{$spacing-hero-tooltip-height};
72
74
  --row-5-lg: 72px;
73
75
 
74
76
  --col-1-lg: 0;
75
77
  --col-2-lg: var(--card-width);
76
- --col-3-lg: #{$tooltip-width};
78
+ --col-3-lg: #{$spacing-hero-tooltip-width};
77
79
  --col-4-lg: 1fr;
78
80
 
79
81
  grid-template-rows:
@@ -109,45 +111,47 @@
109
111
 
110
112
  &__card-size {
111
113
  &__small {
112
- --card-width: minmax(200px, 625px);
114
+ --card-width: 625px;
113
115
  }
114
116
 
115
117
  &__medium {
116
- --card-width: minmax(200px, 721px);
118
+ --card-width: 721px;
117
119
  }
118
120
 
119
121
  &__large {
120
- --card-width: minmax(200px, 856px);
122
+ --card-width: 856px;
121
123
  }
122
124
 
123
125
  &__xlarge {
124
- --card-width: minmax(200px, 920px);
126
+ --card-width: 920px;
125
127
  }
126
128
 
127
129
  &__xxlarge {
128
- --card-width: minmax(200px, 998px);
130
+ --card-width: 998px;
129
131
  }
130
132
  }
131
133
 
132
134
  &__card-justify {
133
135
  &__start {
134
- --col-1-lg: 0;
136
+ --col-1-lg: #{$card-offset};
135
137
  }
136
138
 
137
139
  &__offset {
138
- --col-1-lg: var(--card-offset);
140
+ --col-1-lg: #{$card-offset-justified};
139
141
  }
140
142
 
141
143
  &__center {
142
- --col-1-lg: 1fr;
143
- --col-4-lg: 1fr;
144
+ --col-1-lg: calc((100% - var(--card-width)) / 2);
145
+ --col-4-lg: calc(
146
+ ((100% - var(--card-width)) / 2) - #{$spacing-hero-tooltip-width}
147
+ );
144
148
  }
145
149
  }
146
150
 
147
151
  &__card-align {
148
152
  &__center {
149
- --row-4-lg: calc(72px - #{$tooltip-height});
150
- --row-5-lg: #{$tooltip-height};
153
+ --row-4-lg: calc(72px - #{$spacing-hero-tooltip-height});
154
+ --row-5-lg: #{$spacing-hero-tooltip-height};
151
155
  }
152
156
 
153
157
  &__bottom {
@@ -157,6 +161,46 @@
157
161
  }
158
162
  }
159
163
 
164
+ &__card-background {
165
+ &__transparent {
166
+ #{$c}--card-offset {
167
+ background-color: transparent !important;
168
+ }
169
+ }
170
+ }
171
+
172
+ &__card-theme {
173
+ &__dark {
174
+ #{$c}--card-offset {
175
+ background-color: map-get($color, "base", "blue", "dark");
176
+ }
177
+
178
+ &[class*="semi-transparent"] {
179
+ #{$c}--card-offset {
180
+ background: rgba(
181
+ map-get($color, "hero", "card", "dark", "background"),
182
+ $opacity-semi-transparent
183
+ );
184
+ }
185
+ }
186
+ }
187
+
188
+ &__light {
189
+ #{$c}--card-offset {
190
+ background: map-get($color, "hero", "card", "light", "background");
191
+ }
192
+
193
+ &[class*="semi-transparent"] {
194
+ #{$c}--card-offset {
195
+ background: rgba(
196
+ map-get($color, "hero", "card", "light", "background"),
197
+ $opacity-semi-transparent
198
+ );
199
+ }
200
+ }
201
+ }
202
+ }
203
+
160
204
  &--breadcrumbs {
161
205
  grid-area: 1 / 1 / 2 / 5;
162
206
  z-index: 1;
@@ -164,7 +208,15 @@
164
208
  flex-flow: row nowrap;
165
209
 
166
210
  &--wrapper {
167
- max-width: 500px;
211
+ width: 100%;
212
+ }
213
+
214
+ &:before {
215
+ content: "";
216
+ background-color: $color-base-neutrals-white;
217
+ position: relative;
218
+ height: 100%;
219
+ width: max($spacing-hero-card-padding-x-lg, $base-offset);
168
220
  }
169
221
  }
170
222
 
@@ -180,6 +232,25 @@
180
232
  }
181
233
  }
182
234
 
235
+ &--card-offset {
236
+ grid-area: 3 / 1 / 6 / 2;
237
+ z-index: 0;
238
+ background-color: transparent;
239
+
240
+ #{$c}__card-justify__offset &,
241
+ #{$c}__card-justify__center & {
242
+ background-color: transparent;
243
+ }
244
+
245
+ #{$c}__card-align__center & {
246
+ grid-area: 3 / 1 / 4 / 2;
247
+ }
248
+
249
+ #{$c}__card-align__bottom & {
250
+ grid-area: 4 / 1 / 6 / 2;
251
+ }
252
+ }
253
+
183
254
  &--card {
184
255
  grid-area: 3 / 2 / 6 / 3;
185
256
 
@@ -219,8 +290,8 @@
219
290
  #{$c}--caption--wrapper {
220
291
  @include caption-icon-wrapper(
221
292
  "right",
222
- $tooltip-width,
223
- $tooltip-height
293
+ $spacing-hero-tooltip-width,
294
+ $spacing-hero-tooltip-height
224
295
  );
225
296
 
226
297
  position: absolute;
@@ -240,7 +311,11 @@
240
311
  .right-to-left & {
241
312
  &--caption {
242
313
  &--wrapper {
243
- @include caption-icon-wrapper("left", $tooltip-width, $tooltip-height);
314
+ @include caption-icon-wrapper(
315
+ "left",
316
+ $spacing-hero-tooltip-width,
317
+ $spacing-hero-tooltip-height
318
+ );
244
319
  position: absolute;
245
320
  right: 0;
246
321
  }
@@ -250,23 +325,25 @@
250
325
  &__card-justify {
251
326
  &__start {
252
327
  --col-1-lg: 1fr;
253
- --col-2-lg: #{$tooltip-width};
328
+ --col-2-lg: #{$spacing-hero-tooltip-width};
254
329
  --col-3-lg: var(--card-width);
255
- --col-4-lg: 0;
330
+ --col-4-lg: #{$card-offset};
256
331
  }
257
332
 
258
333
  &__offset {
259
334
  --col-1-lg: 1fr;
260
- --col-2-lg: #{$tooltip-width};
335
+ --col-2-lg: #{$spacing-hero-tooltip-width};
261
336
  --col-3-lg: var(--card-width);
262
- --col-4-lg: var(--card-offset);
337
+ --col-4-lg: #{$card-offset-justified};
263
338
  }
264
339
 
265
340
  &__center {
266
- --col-1-lg: 1fr;
267
- --col-2-lg: #{$tooltip-width};
341
+ --col-1-lg: calc(
342
+ ((100% - var(--card-width)) / 2) - #{$spacing-hero-tooltip-width}
343
+ );
344
+ --col-2-lg: #{$spacing-hero-tooltip-width};
268
345
  --col-3-lg: var(--card-width);
269
- --col-4-lg: 1fr;
346
+ --col-4-lg: calc((100% - var(--card-width)) / 2);
270
347
  }
271
348
  }
272
349
 
@@ -307,8 +384,8 @@
307
384
  &--wrapper {
308
385
  @include caption-icon-wrapper(
309
386
  "left",
310
- $tooltip-width,
311
- $tooltip-height
387
+ $spacing-hero-tooltip-width,
388
+ $spacing-hero-tooltip-height
312
389
  );
313
390
 
314
391
  position: absolute;
@@ -319,6 +396,10 @@
319
396
  }
320
397
  }
321
398
 
399
+ &--card-offset {
400
+ grid-area: 3 / 4 / 6 / 5;
401
+ }
402
+
322
403
  &--card {
323
404
  grid-area: 3 / 3 / 6 / 4;
324
405
  }
@@ -336,8 +417,8 @@
336
417
 
337
418
  @include caption-icon-wrapper(
338
419
  "left",
339
- $tooltip-width,
340
- $tooltip-height
420
+ $spacing-hero-tooltip-width,
421
+ $spacing-hero-tooltip-height
341
422
  );
342
423
  }
343
424
  }
@@ -4,21 +4,13 @@
4
4
 
5
5
  .ilo--hero-card {
6
6
  $c: &;
7
- $semi-transparent: 0.6;
8
-
9
- // Replace with this
10
- $padding-y-lg: $spacing-padding-7;
11
- $padding-x-lg: $spacing-padding-9;
12
-
13
- $padding-y-sm: $spacing-padding-5;
14
- $padding-x-sm: $spacing-padding-2;
15
7
 
16
8
  height: 100%;
17
9
  position: relative;
18
- padding: $padding-y-sm $padding-x-sm;
10
+ padding: $spacing-hero-card-padding-y-sm $spacing-hero-card-padding-x-sm;
19
11
 
20
12
  @include breakpoint("large") {
21
- padding: $padding-y-lg $padding-x-lg;
13
+ padding: $spacing-hero-card-padding-y-lg $spacing-hero-card-padding-x-lg;
22
14
  }
23
15
 
24
16
  .right-to-left & {
@@ -43,7 +35,7 @@
43
35
  &.ilo--hero-card__background__semi-transparent {
44
36
  background: rgba(
45
37
  map-get($color, "hero", "card", "light", "background"),
46
- $semi-transparent
38
+ $opacity-semi-transparent
47
39
  );
48
40
  }
49
41
  }
@@ -57,7 +49,7 @@
57
49
  &.ilo--hero-card__background__semi-transparent {
58
50
  background: rgba(
59
51
  map-get($color, "hero", "card", "dark", "background"),
60
- $semi-transparent
52
+ $opacity-semi-transparent
61
53
  );
62
54
  }
63
55
  }
@@ -79,17 +71,31 @@
79
71
  }
80
72
 
81
73
  &__cornercut {
82
- @include cornercut(70px, 40px);
74
+ @include cornercut(
75
+ $spacing-hero-card-corner-cut-width-sm,
76
+ $spacing-hero-card-corner-cut-height-sm
77
+ );
83
78
 
84
79
  .right-to-left & {
85
- @include cornercut(720px, 40px, "left");
80
+ @include cornercut(
81
+ $spacing-hero-card-corner-cut-width-sm,
82
+ $spacing-hero-card-corner-cut-height-sm,
83
+ "left"
84
+ );
86
85
  }
87
86
 
88
87
  @include breakpoint("large") {
89
- @include cornercut(116px, 64px);
88
+ @include cornercut(
89
+ $spacing-hero-card-corner-cut-width-lg,
90
+ $spacing-hero-card-corner-cut-height-lg
91
+ );
90
92
 
91
93
  .right-to-left & {
92
- @include cornercut(116px, 64px, "left");
94
+ @include cornercut(
95
+ $spacing-hero-card-corner-cut-width-lg,
96
+ $spacing-hero-card-corner-cut-height-lg,
97
+ "left"
98
+ );
93
99
  }
94
100
  }
95
101
  }
@@ -5,6 +5,9 @@
5
5
  .ilo--pagination {
6
6
  display: flex;
7
7
  justify-content: space-between;
8
+ margin-bottom: px-to-rem(
9
+ map-get($spacing, "ux", "pagination", "padding", "top")
10
+ );
8
11
  margin-top: px-to-rem(
9
12
  map-get($spacing, "ux", "pagination", "padding", "top")
10
13
  );