@ilo-org/styles 0.12.0 → 0.13.0

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.12.0",
4
+ "version": "0.13.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/international-labour-organization/designsystem.git",
@@ -32,7 +32,7 @@
32
32
  "gulp-rename": "^2.0.0",
33
33
  "gulp-sass": "^5.1.0",
34
34
  "gulp-sourcemaps": "^3.0.0",
35
- "postcss": "^8.4.21",
35
+ "postcss": "^8.4.31",
36
36
  "postcss-cli": "^10.0.0",
37
37
  "sass": "^1.62.1"
38
38
  },
@@ -5,6 +5,7 @@
5
5
  .ilo--accordion {
6
6
  $transition-timing: 500ms;
7
7
  $scroll-max-height: 300px;
8
+ margin-right: spacing(1);
8
9
 
9
10
  &--button {
10
11
  display: flex;
@@ -72,6 +73,10 @@
72
73
  &[aria-expanded="false"] {
73
74
  @include dataurlicon("add", $color-ux-labels-actionable);
74
75
  }
76
+
77
+ [dir="rtl"] & {
78
+ background-position: calc(0% + px-to-rem(6px)) center;
79
+ }
75
80
  }
76
81
 
77
82
  &--panel {
@@ -82,7 +87,7 @@
82
87
  overflow: hidden;
83
88
 
84
89
  .ilo--accordion--innerpanel {
85
- padding-bottom: spacing(3);
90
+ padding-bottom: spacing(9);
86
91
  padding-top: spacing(2);
87
92
  }
88
93
 
@@ -14,7 +14,7 @@
14
14
  justify-content: flex-start;
15
15
  padding-block: spacing(4);
16
16
  padding-inline-end: 0;
17
- padding-inline-start: var(--card-padding-start);
17
+ padding-inline-start: var(--breadcrumb-padding);
18
18
  position: relative;
19
19
  &.context--menu {
20
20
  padding: 0;
@@ -23,19 +23,20 @@
23
23
 
24
24
  &--link {
25
25
  align-items: center;
26
- background-position: right 52%;
26
+ background-position: right;
27
27
  background-repeat: no-repeat;
28
28
  color: map-get($color, "link", "text", "default");
29
29
  display: inline-flex;
30
30
  height: px-to-rem(16px);
31
- padding: 0 spacing(6) 0 px-to-rem(10px);
31
+ padding-block: 0;
32
+ padding-inline-start: spacing(4);
33
+ padding-inline-end: spacing(6);
32
34
  text-decoration: none;
33
35
  text-decoration-thickness: px-to-rem($borders-base);
34
36
  @include dataurlicon("breadcrumbdivider", $color-link-text-default);
35
37
 
36
38
  [dir="rtl"] & {
37
- background-position: 0 52%;
38
- padding: 0 px-to-rem(10px) 0 spacing(6);
39
+ background-position: left;
39
40
  @include dataurlicon("breadcrumbdividerrtl", $color-link-text-default);
40
41
  }
41
42
 
@@ -89,6 +90,13 @@
89
90
  width: px-to-rem(16px);
90
91
  @include dataurlicon("home", $color-link-text-default);
91
92
  }
93
+
94
+ [dir="rtl"] & {
95
+ &:before {
96
+ left: initial;
97
+ right: 0;
98
+ }
99
+ }
92
100
  }
93
101
 
94
102
  &:hover,
@@ -178,7 +186,7 @@
178
186
  content: "";
179
187
  height: px-to-rem(12px);
180
188
  position: absolute;
181
- left: 50%;
189
+ // left: 50%;
182
190
  top: -#{px-to-rem(6px)};
183
191
  transform: translateX(-50%) rotate(135deg);
184
192
  width: px-to-rem(12px);
@@ -250,46 +258,37 @@
250
258
  text-decoration: underline;
251
259
  text-decoration-thickness: px-to-rem($borders-base);
252
260
  }
253
-
254
- [dir="rtl"] & {
255
- text-align: center;
256
- }
257
261
  }
258
262
  }
259
263
  }
260
264
  }
261
265
 
262
- @include breakpoint("medium") {
263
- &--items {
264
- &:after {
265
- background: linear-gradient(
266
- to bottom right,
267
- white 50%,
268
- transparent 50%
269
- );
270
- content: "";
271
- display: inline-block;
272
- height: 47px;
273
- position: absolute;
274
- right: -47px;
275
- top: 0;
276
- width: 47px;
266
+ &--items {
267
+ &:after {
268
+ background: linear-gradient(to bottom right, white 50%, transparent 50%);
269
+ content: "";
270
+ display: inline-block;
271
+ height: 47px;
272
+ position: absolute;
273
+ right: -47px;
274
+ top: 0;
275
+ width: 47px;
277
276
 
278
- [dir="rtl"] & {
279
- right: auto;
280
- left: -47px;
281
- transform: scaleX(-1);
282
- }
277
+ [dir="rtl"] & {
278
+ right: auto;
279
+ left: -47px;
280
+ transform: scaleX(-1);
283
281
  }
282
+ }
284
283
 
285
- &.context--menu {
286
- &:after {
287
- content: none;
288
- }
284
+ &.context--menu {
285
+ &:after {
286
+ content: none;
289
287
  }
290
288
  }
291
289
  }
292
290
 
291
+ // @TODO: This shouldn't be here, we should handle this through Storybook configuation
293
292
  &.storybook {
294
293
  background-color: $brand-ilo-grey-ui;
295
294
  height: 100vh;
@@ -5,7 +5,7 @@
5
5
 
6
6
  .ilo--card {
7
7
  $self: &;
8
- $transition-timing: 150ms;
8
+ $transition-timing: 250ms;
9
9
  box-sizing: border-box;
10
10
  position: relative;
11
11
  background-color: map-get($color, "base", "neutrals", "white");
@@ -86,6 +86,7 @@
86
86
 
87
87
  &--wrapper {
88
88
  max-width: var(--max-width);
89
+ transition: filter $transition-timing ease-out;
89
90
 
90
91
  &:hover,
91
92
  &:focus,
@@ -145,14 +146,7 @@
145
146
  &--eyebrow {
146
147
  color: $brand-ilo-purple;
147
148
  @include font-styles("body-small");
148
- @include textmargin(
149
- "margin-bottom",
150
- 16px,
151
- "headline-5",
152
- "display",
153
- "body-small",
154
- "copy"
155
- );
149
+ margin-bottom: spacing(3);
156
150
  @include globaltransition("color");
157
151
 
158
152
  #{$self}--link:hover &,
@@ -11,6 +11,11 @@
11
11
  // Total offset from the edge of the window
12
12
  --base-offset: calc(((100vw - #{$layout-max-width}) / 2));
13
13
 
14
+ // Breadcrumb offset. This is used directly by the breadcrumb component
15
+ // Ensures the Breadcrumb aligns to the starting edge of a 1300px content
16
+ // container
17
+ --breadcrumb-padding: max(var(--base-offset), #{spacing(4)});
18
+
14
19
  // Card padding defaults to a fixed value. But it's a CSS variable
15
20
  // so that we can make it squeezy when the card is justified `start`
16
21
  // or `offset`
@@ -47,6 +52,24 @@
47
52
  @include hero-grid-rows();
48
53
  }
49
54
 
55
+ &__gap {
56
+ &__transparent {
57
+ background: transparent;
58
+ }
59
+
60
+ &__white {
61
+ background-color: $brand-ilo-white;
62
+ }
63
+
64
+ &__light {
65
+ background-color: $brand-ilo-light-blue;
66
+ }
67
+
68
+ &__dark {
69
+ background-color: $brand-ilo-dark-blue;
70
+ }
71
+ }
72
+
50
73
  &--breadcrumbs {
51
74
  display: none;
52
75
  }
@@ -196,6 +219,7 @@
196
219
  #{$c}--card-offset {
197
220
  background-color: map-get($color, "base", "blue", "dark");
198
221
  position: relative;
222
+ box-shadow: 0.3px 0 0 0 map-get($color, "base", "blue", "dark");
199
223
  }
200
224
 
201
225
  &[class*="semi-transparent"] {
@@ -204,6 +228,11 @@
204
228
  map-get($color, "hero", "card", "dark", "background"),
205
229
  $opacity-semi-transparent
206
230
  );
231
+ box-shadow: 0.3px 0 0 0
232
+ rgba(
233
+ map-get($color, "hero", "card", "dark", "background"),
234
+ $opacity-semi-transparent
235
+ );
207
236
  }
208
237
  }
209
238
  }
@@ -211,6 +240,8 @@
211
240
  &__light {
212
241
  #{$c}--card-offset {
213
242
  background: map-get($color, "hero", "card", "light", "background");
243
+ box-shadow: 0.3px 0 0 0
244
+ map-get($color, "hero", "card", "light", "background");
214
245
  }
215
246
 
216
247
  &[class*="semi-transparent"] {
@@ -219,19 +250,18 @@
219
250
  map-get($color, "hero", "card", "light", "background"),
220
251
  $opacity-semi-transparent
221
252
  );
253
+ box-shadow: 0.3px 0 0 0
254
+ rgba(
255
+ map-get($color, "hero", "card", "light", "background"),
256
+ $opacity-semi-transparent
257
+ );
222
258
  }
223
259
  }
224
260
  }
225
261
  }
226
262
 
227
- &--breadcrumbs-offset {
228
- grid-area: 1 / 1 / 2 / 2;
229
- background-color: $color-base-neutrals-white;
230
- z-index: 1;
231
- }
232
-
233
263
  &--breadcrumbs {
234
- grid-area: 1 / 2 / 2 / 5;
264
+ grid-area: 1 / 1 / 2 / 5;
235
265
  z-index: 1;
236
266
  display: flex;
237
267
  flex-flow: row nowrap;
@@ -258,21 +288,9 @@
258
288
  z-index: 0;
259
289
  position: relative;
260
290
 
261
- // A band-aid that prevents artifacts from appearing
262
- // between the card and the card offset in Chrome
263
- &::after {
264
- content: "";
265
- position: absolute;
266
- height: 100%;
267
- width: 3px;
268
- right: -1px;
269
- background-color: inherit;
270
- z-index: 1;
271
- }
272
-
273
291
  #{$c}__card-justify__offset &,
274
292
  #{$c}__card-justify__center & {
275
- background-color: transparent;
293
+ background: transparent !important;
276
294
  }
277
295
 
278
296
  #{$c}__card-align__center & {
@@ -8,6 +8,8 @@
8
8
  $arrow-width: calc(spacing(2) - px-to-rem(1));
9
9
 
10
10
  @include font-styles("body-xs");
11
+ font-family: $fonts-copy;
12
+ font-weight: 400;
11
13
  background: map-get($color, "tooltip", "default", "background");
12
14
  border: none;
13
15
  border-radius: px-to-rem(2px);
@@ -21,12 +23,17 @@
21
23
  padding: spacing(2) spacing(4) spacing(3);
22
24
  position: absolute;
23
25
  visibility: hidden;
24
- width: auto;
25
- @include globaltransition("opacity");
26
+ width: max-content;
27
+ max-width: px-to-rem(180px);
28
+
29
+ &--long {
30
+ @include breakpoint("medium") {
31
+ max-width: px-to-rem(400px);
32
+ }
33
+ }
26
34
 
27
35
  &--fade {
28
36
  opacity: 1;
29
- @include globaltransition("opacity");
30
37
  }
31
38
 
32
39
  &--visible {
@@ -35,6 +42,38 @@
35
42
  opacity: 1;
36
43
  }
37
44
 
45
+ // Tooltip arrow styles
46
+ &--arrow,
47
+ &--arrow::before {
48
+ position: absolute;
49
+ visibility: hidden;
50
+ width: 10px;
51
+ height: 10px;
52
+ background: inherit;
53
+ }
54
+
55
+ &--arrow::before {
56
+ visibility: visible;
57
+ content: "";
58
+ transform: rotate(45deg);
59
+ }
60
+
61
+ &[data-popper-placement^="top"] > &--arrow {
62
+ bottom: -4px;
63
+ }
64
+
65
+ &[data-popper-placement^="bottom"] > &--arrow {
66
+ top: -4px;
67
+ }
68
+
69
+ &[data-popper-placement^="left"] > &--arrow {
70
+ right: -4px;
71
+ }
72
+
73
+ &[data-popper-placement^="right"] > &--arrow {
74
+ left: -4px;
75
+ }
76
+
38
77
  &--wrapper {
39
78
  display: inline-block;
40
79
  position: relative;
@@ -53,143 +92,23 @@
53
92
  }
54
93
  }
55
94
 
56
- &--arrow {
57
- border-color: transparent;
58
- border-right-color: transparent;
59
- border-style: solid;
60
- border-width: 0;
61
- height: 0;
62
- margin-top: -#{$arrow-width};
63
- position: absolute;
64
- width: 0;
65
- }
66
-
67
- &--alignment-top {
68
- left: 0;
69
- top: calc(-100% + 12px);
70
-
71
- .ilo--tooltip--arrow {
72
- border-top-color: map-get($color, "tooltip", "default", "background");
73
- border-width: spacing(3) $arrow-width 0 $arrow-width;
74
- bottom: -#{spacing(3)};
75
- left: 50%;
76
- margin-left: -#{$arrow-width};
77
- top: auto;
78
-
79
- &--placement-negative {
80
- left: 10%;
81
- }
82
-
83
- &--placement-positive {
84
- left: auto;
85
- right: 10%;
86
- }
87
-
88
- &--placement-center {
89
- left: 50%;
90
- }
91
- }
92
- }
93
-
94
- &--alignment-right {
95
- left: calc(100% + 32px);
96
- top: calc(50% - $arrow-width);
97
-
98
- .ilo--tooltip--arrow {
99
- border-right-color: map-get($color, "tooltip", "default", "background");
100
- border-width: $arrow-width spacing(3) $arrow-width 0;
101
- left: 0;
102
- margin-left: -#{spacing(3)};
103
- top: 50%;
104
-
105
- &--placement-negative {
106
- margin-top: 0;
107
- top: 10%;
108
- }
109
-
110
- &--placement-positive {
111
- top: auto;
112
- bottom: 10%;
113
- }
114
-
115
- &--placement-center {
116
- top: 50%;
117
- }
118
- }
119
- }
120
-
121
- &--alignment-left {
122
- right: calc(100% + 32px);
123
- top: calc(50% - $arrow-width);
124
-
125
- .ilo--tooltip--arrow {
126
- border-left-color: map-get($color, "tooltip", "default", "background");
127
- border-width: $arrow-width 0 $arrow-width spacing(3);
128
- left: auto;
129
- margin-top: -#{$arrow-width};
130
- right: -#{spacing(3)};
131
- top: 50%;
132
-
133
- &--placement-negative {
134
- margin-top: 0;
135
- top: 10%;
136
- }
137
-
138
- &--placement-positive {
139
- top: auto;
140
- bottom: 10%;
141
- }
142
-
143
- &--placement-center {
144
- top: 50%;
145
- }
146
- }
147
- }
148
-
149
- &--alignment-bottom {
150
- left: 0;
151
- top: calc(100% + spacing(3));
152
-
153
- .ilo--tooltip--arrow {
154
- border-width: 0 $arrow-width spacing(3) $arrow-width;
155
- left: 50%;
156
- margin-left: -#{$arrow-width};
157
- margin-top: -#{spacing(3)};
158
- top: 0;
159
- border-bottom-color: map-get($color, "tooltip", "default", "background");
160
-
161
- &--placement-negative {
162
- left: 10%;
163
- }
164
-
165
- &--placement-positive {
166
- left: auto;
167
- right: 10%;
168
- }
169
-
170
- &--placement-center {
171
- left: 50%;
172
- }
173
- }
174
- }
175
-
176
95
  &--dark {
177
96
  background: map-get($color, "tooltip", "dark", "background");
178
97
  color: map-get($color, "tooltip", "dark", "text");
179
98
 
180
- &.ilo--tooltip--alignment-bottom .ilo--tooltip--arrow {
99
+ &.ilo--tooltip--arrow {
181
100
  border-bottom-color: map-get($color, "tooltip", "dark", "background");
182
101
  }
183
102
 
184
- &.ilo--tooltip--alignment-top .ilo--tooltip--arrow {
103
+ &.ilo--tooltip--arrow {
185
104
  border-top-color: map-get($color, "tooltip", "dark", "background");
186
105
  }
187
106
 
188
- &.ilo--tooltip--alignment-left .ilo--tooltip--arrow {
107
+ &.ilo--tooltip--arrow {
189
108
  border-left-color: map-get($color, "tooltip", "dark", "background");
190
109
  }
191
110
 
192
- &.ilo--tooltip--alignment-right .ilo--tooltip--arrow {
111
+ &.ilo--tooltip--arrow {
193
112
  border-right-color: map-get($color, "tooltip", "dark", "background");
194
113
  }
195
114
  }