@ilo-org/styles 1.7.2 → 1.8.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": "1.7.2",
4
+ "version": "1.8.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/international-labour-organization/designsystem.git",
@@ -38,9 +38,9 @@
38
38
  "author": "@justintemps, @johnpauldavis, @avrilpearl, @ghlost",
39
39
  "license": "Apache-2.0",
40
40
  "dependencies": {
41
+ "@ilo-org/icons": "2.1.0",
41
42
  "@ilo-org/themes": "0.9.1",
42
- "@ilo-org/fonts": "1.0.0",
43
- "@ilo-org/icons": "2.1.0"
43
+ "@ilo-org/fonts": "1.0.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "cssnano": "^7.0.6",
@@ -8,13 +8,13 @@
8
8
  transition: max-height 225ms ease-out;
9
9
  $callout: &;
10
10
 
11
- &--collapse:not(.ilo--callout--open) {
12
- max-height: 64px;
11
+ &__collapse {
12
+ max-height: px-to-rem(64px);
13
13
  overflow: hidden;
14
14
  }
15
15
 
16
- &--open {
17
- max-height: 300px;
16
+ &__open {
17
+ max-height: px-to-rem(300px);
18
18
  overflow: hidden;
19
19
 
20
20
  #{$callout}--toggle--icon {
@@ -22,7 +22,39 @@
22
22
  }
23
23
  }
24
24
 
25
- &__sidebar {
25
+ &__error {
26
+ background: var(--ilo-color-red-ramp);
27
+
28
+ #{$callout}--sidebar {
29
+ background: var(--ilo-color-red);
30
+ }
31
+ }
32
+
33
+ &__info {
34
+ background: var(--ilo-color-blue-light);
35
+
36
+ #{$callout}--sidebar {
37
+ background: var(--ilo-color-blue);
38
+ }
39
+ }
40
+
41
+ &__success {
42
+ background: var(--ilo-color-green-ramp);
43
+
44
+ #{$callout}--sidebar {
45
+ background: var(--ilo-color-green);
46
+ }
47
+ }
48
+
49
+ &__warning {
50
+ background: var(--ilo-color-yellow-ramp);
51
+
52
+ #{$callout}--sidebar {
53
+ background: var(--ilo-color-yellow);
54
+ }
55
+ }
56
+
57
+ &--sidebar {
26
58
  display: flex;
27
59
  flex-direction: column;
28
60
  align-items: center;
@@ -34,43 +66,40 @@
34
66
  }
35
67
  }
36
68
 
37
- &__content {
69
+ &--content {
70
+ color: var(--ilo-color-gray-charcoal);
38
71
  padding: spacing(6);
39
72
  width: 100%;
40
73
  font-size: px-to-rem(14px);
41
74
  }
42
75
 
43
- &__header {
76
+ &--header {
44
77
  display: flex;
45
78
  justify-content: space-between;
46
79
  padding-block-end: spacing(3);
47
80
  }
48
81
 
49
- &__title {
50
- @include font-styles("nav-bold-b");
51
- font-family: var(--ilo-fonts-display);
82
+ &--title {
83
+ @include typography("highlight-medium");
52
84
  font-weight: 700;
53
85
  }
54
86
 
55
- &__description {
87
+ &--description {
56
88
  font-weight: 400;
57
89
  }
58
90
 
59
91
  &--toggle {
60
- @include font-styles("nav-bold-b");
61
-
92
+ @include typography("highlight-medium-bold");
62
93
  background: none;
63
94
  border: none;
64
95
  color: var(--ilo-color-blue-dark);
65
96
  cursor: pointer;
66
- font-family: var(--ilo-fonts-display);
67
97
  font-weight: 500;
68
98
  padding-inline-end: spacing(8);
69
99
  position: relative;
70
100
 
71
- &__icon {
101
+ &--icon {
72
102
  @include icon("chevron_down", var(--ilo-color-blue-dark));
73
-
74
103
  background-position: right;
75
104
  background-repeat: no-repeat;
76
105
  display: inline-block;
@@ -84,63 +113,33 @@
84
113
  }
85
114
  }
86
115
 
87
- &__footer {
116
+ &--footer {
88
117
  padding-block-start: spacing(5);
89
118
  }
90
119
 
91
- .icon {
120
+ &--icon {
92
121
  background-repeat: no-repeat;
93
122
  background-size: contain;
94
123
  display: block;
95
124
  height: px-to-rem(24px);
96
125
  width: px-to-rem(24px);
97
126
 
98
- &__error {
99
- @include icon("notification_error", var(--ilo-color-white));
100
- }
127
+ &__alert {
128
+ &__error {
129
+ @include icon("notification_error", var(--ilo-color-white));
130
+ }
101
131
 
102
- &__info {
103
- @include icon("notification_info", var(--ilo-color-white));
104
- }
105
-
106
- &__success {
107
- @include icon("notification_success", var(--ilo-color-white));
108
- }
109
-
110
- &__warning {
111
- @include icon("notification_warning", var(--ilo-color-white));
112
- }
113
- }
114
-
115
- &__error {
116
- background: var(--ilo-color-red-ramp);
117
-
118
- #{$callout}__sidebar {
119
- background: var(--ilo-color-red);
120
- }
121
- }
122
-
123
- &__info {
124
- background: var(--ilo-color-blue-ramp);
125
-
126
- #{$callout}__sidebar {
127
- background: var(--ilo-color-blue);
128
- }
129
- }
130
-
131
- &__success {
132
- background: var(--ilo-ramp-green);
132
+ &__info {
133
+ @include icon("notification_info", var(--ilo-color-white));
134
+ }
133
135
 
134
- #{$callout}__sidebar {
135
- background: var(--ilo-color-green);
136
- }
137
- }
136
+ &__success {
137
+ @include icon("notification_success", var(--ilo-color-white));
138
+ }
138
139
 
139
- &__warning {
140
- background: var(--ilo-color-yellow-ramp);
141
-
142
- #{$callout}__sidebar {
143
- background: var(--ilo-color-yellow);
140
+ &__warning {
141
+ @include icon("notification_warning", var(--ilo-color-white));
142
+ }
144
143
  }
145
144
  }
146
145
  }
@@ -1,12 +1,13 @@
1
1
  @use "../tokens" as *;
2
2
  @use "../functions" as *;
3
3
  @import "../mixins";
4
+ @import "../animations";
4
5
 
5
6
  .ilo--language-toggle {
6
7
  --ilo--language-toggle-color: var(--ilo-color-white);
7
- --ilo--language-toggle-color-hover: var(--ilo-color-blue);
8
+ --ilo--language-toggle-color-hover: var(--ilo-color-white);
8
9
  --ilo--language-toggle-bg: transparent;
9
- --ilo--language-toggle-bg-hover: transparent;
10
+ --ilo--language-toggle-bg-hover: var(--ilo-color-blue-dark);
10
11
 
11
12
  &__theme {
12
13
  &__dark {
@@ -15,16 +16,13 @@
15
16
  }
16
17
  }
17
18
 
18
- &:hover,
19
- &__open {
20
- --ilo--language-toggle-color: var(--ilo--language-toggle-color-hover);
21
- --ilo--language-toggle-bg: var(--ilo--language-toggle-bg-hover);
22
- }
23
-
24
19
  display: inline-block;
20
+ height: 100%;
25
21
 
26
22
  &--container {
27
- // Button unsets to perserve accessibility
23
+ @include globaltransition("background-color, color");
24
+
25
+ height: 100%;
28
26
  background: none;
29
27
  border: none;
30
28
  padding: 0;
@@ -35,16 +33,19 @@
35
33
  box-shadow: none;
36
34
  appearance: none;
37
35
  cursor: pointer;
38
-
39
36
  display: flex;
40
37
  align-items: center;
41
38
  gap: px-to-rem(4px);
42
39
  cursor: pointer;
43
40
  width: fit-content;
44
41
  background-color: var(--ilo--language-toggle-bg);
42
+ color: var(--ilo--language-toggle-color);
45
43
 
46
- &:hover {
47
- background-color: var(--ilo--language-toggle-bg-hover);
44
+ &:hover,
45
+ &:focus,
46
+ &__open {
47
+ --ilo--language-toggle-color: var(--ilo--language-toggle-color-hover);
48
+ --ilo--language-toggle-bg: var(--ilo--language-toggle-bg-hover);
48
49
  }
49
50
  }
50
51
 
@@ -66,8 +67,6 @@
66
67
 
67
68
  &--action {
68
69
  color: var(--ilo--language-toggle-color);
69
-
70
- //move this when the new typography is ready ##896
71
70
  font-family: var(--ilo-fonts-display);
72
71
  font-weight: 700;
73
72
  font-size: px-to-rem(14px);
@@ -94,5 +93,9 @@
94
93
  visibility: visible;
95
94
  transform: translateY(0);
96
95
  }
96
+
97
+ &:focus {
98
+ outline: none;
99
+ }
97
100
  }
98
101
  }
@@ -40,8 +40,9 @@
40
40
  top: 50%;
41
41
  left: 50%;
42
42
  transform: translate(-50%, -50%);
43
- height: auto;
43
+ height: 100%;
44
44
  width: 100%;
45
+ object-fit: cover;
45
46
  }
46
47
  }
47
48
 
@@ -56,7 +57,14 @@
56
57
  #{$self}--title {
57
58
  @include typography("heading-3");
58
59
  margin-bottom: spacing(6);
59
- color: var(--ilo-color-blue-dark);
60
+
61
+ #{$self}__theme__dark & {
62
+ color: var(--ilo-color-blue-dark);
63
+ }
64
+
65
+ #{$self}__theme__light & {
66
+ color: var(--ilo-color-white);
67
+ }
60
68
  }
61
69
 
62
70
  #{$self}--area {
@@ -78,8 +86,12 @@
78
86
  display: flex;
79
87
  flex-flow: row nowrap;
80
88
  justify-content: flex-start;
81
- align-items: center;
89
+ align-items: flex-start;
82
90
  gap: spacing(2);
91
+
92
+ .ilo--icon {
93
+ flex: 0 0 20px;
94
+ }
83
95
  }
84
96
 
85
97
  &#{$self}__size {
@@ -35,35 +35,20 @@
35
35
  cursor: pointer;
36
36
 
37
37
  &-logo {
38
- display: flex;
39
- align-items: center;
40
38
  height: px-to-rem(38px);
41
- padding-inline-end: spacing(4);
42
- border-right: 1px solid var(--ilo-color-white);
43
-
44
- [dir="rtl"] & {
45
- padding-inline-start: spacing(4);
46
- border-right: none;
47
- border-left: 1px solid var(--ilo-color-white);
48
- }
39
+ width: auto;
49
40
 
50
41
  img {
51
42
  height: 100%;
52
43
  }
53
44
  }
54
-
55
- &-name {
56
- padding-inline-start: spacing(4);
57
- color: var(--ilo-color-white);
58
- @include typography("heading-3");
59
- font-size: px-to-rem(16px); //Designs have wrong config
60
- }
61
45
  }
62
46
 
63
47
  &__menu {
64
48
  display: flex;
65
49
  align-items: center;
66
- gap: px-to-rem(48px);
50
+ height: 100%;
51
+ // gap: px-to-rem(48px);
67
52
 
68
53
  @include breakpoint("lg", true) {
69
54
  display: none;
@@ -113,8 +98,6 @@
113
98
  height: inherit;
114
99
  width: 100%;
115
100
  display: flex;
116
- gap: px-to-rem(12px);
117
- padding-inline: spacing(3);
118
101
  align-items: center;
119
102
  }
120
103
 
@@ -126,34 +109,46 @@
126
109
  display: flex;
127
110
  align-items: center;
128
111
  text-wrap: nowrap;
112
+ padding-inline: spacing(3);
129
113
 
130
- &:hover {
131
- color: var(--ilo-color-blue);
114
+ &:hover,
115
+ &:focus {
116
+ background-color: var(--ilo-color-blue-dark);
117
+ color: var(--ilo-color-white);
132
118
  }
133
119
  }
134
120
 
135
121
  &-language {
136
- .ilo--language-toggle__theme__dark {
137
- --ilo--language-toggle-color-hover: var(--ilo-color-blue);
138
- }
139
122
  position: relative;
140
123
  height: 100%;
141
124
  display: flex;
142
125
  align-items: center;
126
+
127
+ button {
128
+ padding-inline: spacing(3);
129
+ }
143
130
  }
144
131
 
145
132
  &-search {
146
133
  --ilo-subsite-nav-widget-bar-search-color: var(--ilo-color-blue-dark);
147
134
  height: 100%;
148
- display: flex;
135
+ display: inline-flex;
149
136
  align-items: center;
150
- width: px-to-rem(24px);
151
- height: px-to-rem(24px);
137
+ padding-inline: spacing(3);
152
138
 
153
- @include icon("search", var(--ilo-subsite-nav-widget-bar-search-color));
139
+ &:after {
140
+ content: "";
141
+ display: flex;
142
+ align-items: center;
143
+ width: px-to-rem(24px);
144
+ height: px-to-rem(24px);
145
+ @include icon("search", var(--ilo-subsite-nav-widget-bar-search-color));
146
+ }
154
147
 
155
- &:hover {
156
- --ilo-subsite-nav-widget-bar-search-color: var(--ilo-color-blue);
148
+ &:hover,
149
+ &:focus {
150
+ --ilo-subsite-nav-widget-bar-search-color: var(--ilo-color-white);
151
+ background-color: var(--ilo-color-blue-dark);
157
152
  }
158
153
  }
159
154
  }
@@ -83,18 +83,9 @@
83
83
  text-decoration: none;
84
84
  color: var(--ilo-color-white);
85
85
 
86
- &:hover {
87
- background-color: var(--ilo-color-blue-lighter);
88
- color: var(--ilo-color-blue);
89
- }
90
- }
91
-
92
- &__language {
93
- &:hover {
94
- height: 100%;
95
- display: flex;
96
- align-items: center;
97
- background-color: var(--ilo-color-blue-lighter);
86
+ &:hover,
87
+ &:focus {
88
+ background-color: var(--ilo-color-blue-dark);
98
89
  }
99
90
  }
100
91
  }
@@ -133,8 +124,8 @@
133
124
 
134
125
  &__logo img {
135
126
  height: 100%;
136
- padding-inline-end: spacing(4);
137
- border-inline-end: 1px solid var(--ilo-color-blue-dark);
127
+ height: px-to-rem(72px);
128
+ width: auto;
138
129
  }
139
130
 
140
131
  &__name {
@@ -169,6 +160,7 @@
169
160
  }
170
161
 
171
162
  &-menu {
163
+ height: 100%;
172
164
  @include breakpoint("lg", true) {
173
165
  display: none;
174
166
  }
@@ -185,20 +177,13 @@
185
177
 
186
178
  &__logo {
187
179
  padding-inline-end: spacing(4);
188
- border-inline-end: 1px solid var(--ilo-color-white);
189
180
  height: px-to-rem(38px);
190
181
 
191
182
  img {
192
183
  height: 100%;
184
+ width: auto;
193
185
  }
194
186
  }
195
-
196
- &__name {
197
- padding-inline-start: spacing(4);
198
- color: var(--ilo-color-white);
199
- @include typography("heading-3");
200
- font-size: px-to-rem(16px); //Designs have wrong config
201
- }
202
187
  }
203
188
 
204
189
  &-search {
@@ -222,9 +207,10 @@
222
207
  cursor: pointer;
223
208
  }
224
209
 
225
- &:hover {
226
- --ilo-subsite_nav_complex-search-color: var(--ilo-color-blue);
227
- background-color: var(--ilo-color-blue-lighter);
210
+ &:hover,
211
+ &:focus {
212
+ --ilo-subsite_nav_complex-search-color: var(--ilo-color-white);
213
+ background-color: var(--ilo-color-blue-dark);
228
214
  }
229
215
  }
230
216
 
@@ -2,6 +2,7 @@
2
2
  @use "../../functions" as *;
3
3
  @import "../../mixins";
4
4
  @import "../../config";
5
+ @import "../../animations";
5
6
 
6
7
  .ilo--nav-menu {
7
8
  display: flex;
@@ -14,16 +15,13 @@
14
15
 
15
16
  &__list {
16
17
  display: flex;
17
- gap: spacing(12);
18
18
  align-items: center;
19
-
20
- @include breakpoint("xl", true) {
21
- gap: spacing(6);
22
- }
19
+ height: 100%;
23
20
  }
24
21
 
25
22
  &__item {
26
23
  display: flex;
24
+ height: 100%;
27
25
  }
28
26
 
29
27
  &__link {
@@ -33,29 +31,24 @@
33
31
  position: relative;
34
32
  padding-bottom: 2px;
35
33
  text-wrap: nowrap;
36
-
37
- &::after {
38
- content: "";
39
- position: absolute;
40
- bottom: 0;
41
- left: 0;
42
- width: 0;
43
- height: 2px;
44
- background-color: var(--ilo-color-white);
45
- transition: width 0.3s ease;
46
- }
34
+ display: flex;
35
+ flex-direction: column;
36
+ justify-content: center;
37
+ @include globaltransition("background-color");
38
+ padding-inline: spacing(6);
47
39
 
48
40
  &--active,
49
41
  &:hover,
50
42
  &:focus,
51
43
  &:active {
52
- &::after {
53
- width: 100%;
54
- }
44
+ background-color: var(--ilo-color-blue-dark);
45
+ outline: none;
55
46
  }
56
47
  }
57
48
 
58
49
  &__more {
50
+ @include globaltransition("background-color, border-color");
51
+
59
52
  @include breakpoint("lg", true) {
60
53
  display: none;
61
54
  }
@@ -82,10 +75,11 @@
82
75
 
83
76
  &--open,
84
77
  &:hover,
78
+ &:focus,
85
79
  &:active {
86
- --ilo-nav_menu-icon-color: var(--ilo-color-blue);
87
- background-color: var(--ilo-color-blue-lighter);
88
- color: var(--ilo-color-blue);
80
+ outline: none;
81
+ border-color: var(--ilo-color-blue-dark);
82
+ background-color: var(--ilo-color-blue-dark);
89
83
  }
90
84
  }
91
85
  }
@@ -7,34 +7,18 @@
7
7
  &__branding {
8
8
  display: flex;
9
9
  align-items: center;
10
- height: px-to-rem(38px);
11
10
  }
12
11
 
13
12
  &__logo {
14
13
  display: flex;
15
14
  align-items: center;
16
- padding-inline-end: spacing(4);
17
- border-right: 1px solid var(--ilo-color-blue-dark);
18
-
19
- [dir="rtl"] & {
20
- padding-inline-start: spacing(4);
21
- border-right: none;
22
- border-left: 1px solid var(--ilo-color-blue-dark);
23
- }
15
+ height: px-to-rem(38px);
24
16
 
25
17
  img {
26
18
  height: 100%;
27
19
  }
28
20
  }
29
21
 
30
- &__name {
31
- padding-inline-start: spacing(4);
32
- font-weight: 700;
33
- font-size: px-to-rem(13);
34
- line-height: 125%;
35
- color: var(--ilo-color-blue-dark);
36
- }
37
-
38
22
  &__widgets {
39
23
  &-search {
40
24
  padding: spacing(4) 0;